I have a data for the urine test results. Two samples have been taken from each patient in different days and tested by the LAM test and urine dipstick for different biomarkers.
The data looks like this:
```
Subject SampNum LAMresult dipstick_bio1 dipstick_bio2 ...
1 1 1 2 +
1 2 0 1 -
2 1 1 3 .
2 2 1 2 +
```
I would like to find the impact of the dipstick biomarkers on the LAM test positivity using a logistic regression. I am using the following SAS code to carry the logistic model:
```
proc logistic data=data descending;
class dipstick_bio1 dipstick_bio2 .../ param=ref ;
model LAMresult = dipstick_bio1 dipstick_bio2 ;
run;
```
I am thinking to use rather a mixed effects logistic regression model here, which will take account of the non-independence within subjects. It should fit random intercepts for subjects. I am trying to use PROC GLIMMIX. Do you know how can I fit the GlimmiX to my problem?
Hi,
Here's a straightforward explanation of glimmix for this type of problem: https://support.sas.com/resources/papers/proceedings14/SAS026-2014.pdf
You want something like:
proc glimmix data=data;
class patient dipstick_bio1 dipstick_bio2;
model LAMresult = dipstick_bio1 dipstick_bio2 /solution;
random intercept / subject = patient ;
run;
Thank you so much. I am using the following code:
proc glimmix data=all;
class studyID GLUresults BILresults KETresults SGgradingresult BLOresults pHgradingresult
PROresults UROresults NITresults LEUresults albuminr;
model result = albuminr GLUresults BILresults KETresults SGgradingresult BLOresults pHgradingresult
PROresults UROresults NITresults LEUresults /solution;
random intercept / subject = studyID ;
*lsmeans albuminr GLUresults BILresults KETresults SGgradingresult BLOresults pHgradingresult
PROresults UROresults NITresults LEUresults/ cl ;
run;
I get the following output (see the attached file). My response variable is binary but the covariates have different values, e.g PHgrading:1-7 and so on. How could I also have the confidence intervals? What is the best way to present and interpret these results?
Hey there--I'm not looking at your output (try pasting it in, ppl aren't likely to download files). But I can see that you need to specify your distribution and linkage function.
Regarding your covariates, if they are flagged as categorical variables (in your class statement) then they will be treated as such in your model--each level is evaluated relative to the reference. You could use estimate statements to obtain the level-specific parameter (and as you do below, use the cl command to get CI).
To interpret results of logistic regression, you need to understand odds ratios. I like this page for explaining this: https://stats.idre.ucla.edu/other/mult-pkg/faq/general/faq-how-do-i-interpret-odds-ratios-in-logisti...
I think this is different from the one I linked to previously, but has information specifically on binomial outcome: https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2179-2018.pdf
Good luck!
Effect | GLUresults | SGgradingresult | pHgradingresult | Estimate | Standard | DF | t Value | Pr > |t| |
Intercept |
|
|
| 0.3818 | 0.1166 | 203 | 3.27 | 0.0012 |
albuminr |
|
|
| -0.07696 | 0.05561 | 43 | -1.38 | 0.1736 |
albuminr |
|
|
| 0 | . | . | . | . |
GLUresults | 1 |
|
| -0.1192 | 0.3805 | 43 | -0.31 | 0.7556 |
GLUresults | 2 |
|
| 0 | . | . | . | . |
SGgradingresult |
| 1 |
| 0.04574 | 0.1004 | 43 | 0.46 | 0.6511 |
SGgradingresult |
| 2 |
| -0.04829 | 0.09732 | 43 | -0.50 | 0.6223 |
SGgradingresult |
| 3 |
| -0.2017 | 0.1050 | 43 | -1.92 | 0.0615 |
SGgradingresult |
| 4 |
| -0.1229 | 0.1103 | 43 | -1.11 | 0.2713 |
SGgradingresult |
| 5 |
| -0.2331 | 0.1246 | 43 | -1.87 | 0.0681 |
SGgradingresult |
| 6 |
| -0.1337 | 0.1493 | 43 | -0.90 | 0.3755 |
SGgradingresult |
| 7 |
| 0 | . | . | . | . |
pHgradingresult |
|
| 1 | -0.06274 | 0.05959 | 43 | -1.05 | 0.2982 |
pHgradingresult |
|
| 2 | -0.1567 | 0.08566 | 43 | -1.83 | 0.0743 |
pHgradingresult |
|
| 3 | -0.2503 | 0.09530 | 43 | -2.63 | 0.0119 |
pHgradingresult |
|
| 4 | -0.2056 | 0.1198 | 43 | -1.72 | 0.0933 |
pHgradingresult |
|
| 5 | -0.1641 | 0.1073 | 43 | -1.53 | 0.1335 |
pHgradingresult |
|
| 6 | 0.01038 | 0.1394 | 43 | 0.07 | 0.9410 |
pHgradingresult |
|
| 7 | 0 | . | . | . | . |
Type III Tests of Fixed Effects | ||||
Effect | Num DF | Den DF | F Value | Pr > F |
albuminr | 1 | 43 | 1.91 | 0.1736 |
GLUresults | 1 | 43 | 0.10 | 0.7556 |
SGgradingresult | 6 | 43 | 2.20 | 0.0619 |
BLOresults | 1 | 43 | 6.23 | 0.0164 |
pHgradingresult | 6 | 43 | 1.77 | 0.1281 |
Here is my output.
You can get confidence intervals for the coefficients by adding the option CL to the MODEL statement.
The best way to present the results, in my opinion, is to use the Least Squares Means output, which I see you have commented out in your code.
Thank you. When I am using the least squares mean values I get different estimates, confidence intervals and p-values compared to the solution for the fixed effects and Type III tests of fixed effects tables. For example for KET and SG I get:
KETresults | Estimate | Standard | DF | t Value | Pr > |t| | Alpha | Lower | Upper |
1 | 0.05575 | 0.2325 | 43 | 0.24 | 0.8117 | 0.05 | -0.4132 | 0.5247 |
2 | 0.2528 | 0.2163 | 43 | 1.17 | 0.2490 | 0.05 | -0.1835 | 0.6891 |
SGgradingresult | Estimate | Standard | DF | t Value | Pr > |t| | Alpha | Lower | Upper |
1 | 0.2992 | 0.2265 | 43 | 1.32 | 0.1935 | 0.05 | -0.1575 | 0.7559 |
2 | 0.2051 | 0.2279 | 43 | 0.90 | 0.3731 | 0.05 | -0.2544 | 0.6647 |
3 | 0.05176 | 0.2261 | 43 | 0.23 | 0.8200 | 0.05 | -0.4042 | 0.5077 |
4 | 0.1305 | 0.2206 | 43 | 0.59 | 0.5571 | 0.05 | -0.3143 | 0.5754 |
5 | 0.02036 | 0.2377 | 43 | 0.09 | 0.9321 | 0.05 | -0.4590 | 0.4997 |
6 | 0.1197 | 0.2438 | 43 | 0.49 | 0.6260 | 0.05 | -0.3719 | 0.6113 |
7 | 0.2534 | 0.2370 | 43 | 1.07 | 0.2909 | 0.05 | -0.2246 | 0.7314 |
Which one is the correct one to be reported? Do I need to define a reference for PH and SG results which have 1-7 values? How can I interpret them?
Which is correct? They are both correct, because they are different ways of representing the same data. I wrote a brief explanation here:
which also helps explain my preference for presenting the Least Squares Means rather than the regression coefficients
I see, it is now clear. Do I need to define a reference value for PH and SG results which have 1-7 values? How can I adjust the model for confounding factors of age, HIV status and Immunological evidence?
@ph6 wrote:
I see, it is now clear. Do I need to define a reference value for PH and SG results which have 1-7 values?
No
How can I adjust the model for confounding factors of age, HIV status and Immunological evidence?
You have to add age, HIV status and immunological evidence into the model.
Thank you. Using least square means method I am getting negative values for the lower bound of the confidence intervals. Can I report them as they are or replace by zero?
If these are variables that can't go below zero, then yes you can report them as zero.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: