- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I ran the below code for 3 seperate univariate logistic regrssion models for 3 time variables with the outcome of death (0 vs. 1). The time variables have hr:min:sec format. Proc contents shows the format is "time". Please see attached dataset "Sample1.xsxl.".
proc logistic data=Sample1 descending;
model Death = Culture_TIME;
format Culture_TIME time.;
run;
proc logistic data=Sample1 descending;
model Death = Treatment_TIME;
format Treatment_TIME time.;
run;
proc logistic data=Sample1 descending;
model Death = Total_TIME;
format Total_TIME time.;
run;
However, the 3 odds ratios and 95% CIs are the same 1.00 (1.00-1.00), which makes me wonder if I did something wrong. Could anyone please verify the results for me?
Thank you so much!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try adding the CLODDS= option to the model statement
model Death = Culture_TIME / CLODDS=Wald;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1) your attachment didn't attach
2)Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.
You may need to double check the actual values of your "time". Excel does "time" as fractions of a day and depending on the method used to read the data you may need to do some additional conversion, especially if you used proc import to get the data into SAS. If you run proc means on your data and the max value is <1 then you likely have this issue.
One solution might be to make sure the columns in Excel are formatted for time, export to a CSV file and then import that.
When SAS shows the same value as upper and lower bound of an interval it often means there is something related to the format. Formats will round values to display. So if the actual values were something like 0.95 and 1.03 you might see that displayed.
You might try changing the format to something like BEST8. The results should then be displayed in seconds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just uploaded the Excel file. I changed the format to Best8. but I still got 1.00 (1.00-1.00) results.
Analysis Variable : Culture_time | ||||
---|---|---|---|---|
N | Mean | Std Dev | Minimum | Maximum |
161 | 198537.02 | 107437.48 | 45240.00 | 562200.00 |
Model Information | ||
---|---|---|
Data Set | WORK.Sample1 | |
Response Variable | Death | Death |
Number of Response Levels | 2 | |
Model | binary logit | |
Optimization Technique | Fisher's scoring |
Number of Observations Read | 161 |
---|---|
Number of Observations Used | 161 |
Response Profile | ||
---|---|---|
Ordered Value |
Death | Total Frequency |
1 | 1 | 46 |
2 | 0 | 115 |
Probability modeled is Death=1. |
Model Convergence Status |
---|
Convergence criterion (GCONV=1E-8) satisfied. |
Model Fit Statistics | ||
---|---|---|
Criterion | Intercept Only | Intercept and Covariates |
AIC | 194.643 | 193.048 |
SC | 197.724 | 199.211 |
-2 Log L | 192.643 | 189.048 |
Testing Global Null Hypothesis: BETA=0 | |||
---|---|---|---|
Test | Chi-Square | DF | Pr > ChiSq |
Likelihood Ratio | 3.5949 | 1 | 0.0580 |
Score | 3.7231 | 1 | 0.0537 |
Wald | 3.6045 | 1 | 0.0576 |
Analysis of Maximum Likelihood Estimates | |||||
---|---|---|---|---|---|
Parameter | DF | Estimate | Standard Error |
Wald Chi-Square |
Pr > ChiSq |
Intercept | 1 | -1.5334 | 0.3782 | 16.4420 | <.0001 |
Culture_TIME | 1 | 3.007E-6 | 1.584E-6 | 3.6045 | 0.0576 |
Odds Ratio Estimates | |||
---|---|---|---|
Effect | Point Estimate | 95% Wald Confidence Limits |
|
Culture_TIME | 1.000 | 1.000 | 1.000 |
Association of Predicted Probabilities and Observed Responses |
|||
---|---|---|---|
Percent Concordant | 56.3 | Somers' D | 0.126 |
Percent Discordant | 43.7 | Gamma | 0.126 |
Percent Tied | 0.0 | Tau-a | 0.052 |
Pairs | 5290 | c | 0.563 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you write the confidence interval for the odds ratio to a SAS data set, you will see that the values are not 1.000 if you display more than three decimal places.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The estimated odds ratios are for a 1 second change in time, which is very small compared to the range represented in your data. Use the UNITS statemant to change the time units of your estimates, for example:
UNITS culture_time='01:00:00't ; /* 1 hour time unit */
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @PGStats ,
I added the Units Statement into the code below:
proc logistic data=Sample1 descending;
model Death = Culture_TIME;
UNITS Culture_TIME='01:00:00't ; /* 1 hour time unit */
format Culture_TIME BEST8.;
run;
Testing Global Null Hypothesis: BETA=0 | |||
---|---|---|---|
Test | Chi-Square | DF | Pr > ChiSq |
Likelihood Ratio | 3.5949 | 1 | 0.0580 |
Score | 3.7231 | 1 | 0.0537 |
Wald | 3.6045 | 1 | 0.0576 |
Analysis of Maximum Likelihood Estimates | |||||
---|---|---|---|---|---|
Parameter | DF | Estimate | Standard Error |
Wald Chi-Square |
Pr > ChiSq |
Intercept | 1 | -1.5334 | 0.3782 | 16.4420 | <.0001 |
Culture_TIME | 1 | 3.007E-6 | 1.584E-6 | 3.6045 | 0.0576 |
Odds Ratio Estimates | |||
---|---|---|---|
Effect | Point Estimate | 95% Wald Confidence Limits |
|
Culture_TIME | 1.000 | 1.000 | 1.000 |
Association of Predicted Probabilities and Observed Responses |
|||
---|---|---|---|
Percent Concordant | 56.3 | Somers' D | 0.126 |
Percent Discordant | 43.7 | Gamma | 0.126 |
Percent Tied | 0.0 | Tau-a | 0.052 |
Pairs | 5290 | c | 0.563 |
Odds Ratios | ||
---|---|---|
Effect | Unit | Estimate |
Culture_TIME | 3600.0 | 1.011 |
Then I got this OR = 1.011 for unit 3600 seconds. Is there a way to output the 95% C.I. as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try adding the CLODDS= option to the model statement
model Death = Culture_TIME / CLODDS=Wald;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @PGStats ,
It worked!!! Thank you so much!!!