Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- Logistic regression

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-16-2018 02:51 PM
(882 views)

I want to check the OR of some independent variables in a logistic model.

I used this model :

**proc logistic** data=results2 descending;

where season between 1001 and 3254;**class**

source_revenu_cat (param=ref ref='Aucune')

betail (param=ref ref='auc')**terres_acces (param=ref ref='Non')**

region (param=ref ref='1-Sud')

v_urban_rural (param=ref ref='rural')

etudes_ppt_cat (param=ref ref="A - Jamais allée à l'école")

personnes_menage_nombre1 (param=ref ref='1 à 3')

adultes_15_ans_plus (param=ref ref='1 ou plus');**model MDD_W_5 (event='Oui')**= region v_urban_rural adultes_15_ans_plus source_revenu_cat **terres_acces** betail etudes_ppt_cat

personnes_menage_nombre1 ;

**format** season saison.;**run;**

**The table of the OR gave me this result; though the percentages don't seem to match !! did I do something wrong with the code or the interpretation ??**

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@sebai wrote:

By the percentages don't match: I mean that because 24% is higher than 19.1% then

the OR should be more than 1, right !!?

I think your assumption here is incorrect, you can review how Odds Ratio are calculated here.

And your output is clearly not the default SAS output, so it's been manipulated somehow already. **Check your actual results from the PROC LOGISTIC and you'll see that the output does not include the Odds Ratio of 1 or an estimate for the reference levels.** By default there is no estimate for the reference level, but you're setting it to 1 as the reference level somewhere, which is technically correct. The reference level is assumed to be at 1, since by default the comparisons are to the reference level for categorical data.

You set terres_access to have the reference level be NO.

`terres_acces (param=ref ref='Non')`

PS. You do note need to set PARAM=REF for every variable you can include it at the end instead and it applies to all variables. If you have different parameterization methods for variables then you would need to set it individually.

`class <list of variables and reference levels> / param=ref;`

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

What do you mean 'the percentages don't match'?

I suspect you may have lost some observations due to missing data in the other variables, you can see this by looking at the top of the results and checking how many observations were used in the model.

@sebai wrote:

I want to check the OR of some independent variables in a logistic model.

I used this model :

proc logisticdata=results2 descending;

where season between 1001 and 3254;class

source_revenu_cat (param=ref ref='Aucune')

betail (param=ref ref='auc')terres_acces (param=ref ref='Non')

region (param=ref ref='1-Sud')

v_urban_rural (param=ref ref='rural')

etudes_ppt_cat (param=ref ref="A - Jamais allée à l'école")

personnes_menage_nombre1 (param=ref ref='1 à 3')

adultes_15_ans_plus (param=ref ref='1 ou plus');model MDD_W_5 (event='Oui')= region v_urban_rural adultes_15_ans_plus source_revenu_catterres_accesbetail etudes_ppt_catpersonnes_menage_nombre1 ;

formatseason saison.;run;

The table of the OR gave me this result; though the percentages don't seem to match !! did I do something wrong with the code or the interpretation ??

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Actually, all my observations were used I have no missing data.

By the percentages don't match: I mean that because 24% is higher than 19.1% then **the OR should be more than 1, right !!?**

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@sebai wrote:

By the percentages don't match: I mean that because 24% is higher than 19.1% then

the OR should be more than 1, right !!?

I think your assumption here is incorrect, you can review how Odds Ratio are calculated here.

And your output is clearly not the default SAS output, so it's been manipulated somehow already. **Check your actual results from the PROC LOGISTIC and you'll see that the output does not include the Odds Ratio of 1 or an estimate for the reference levels.** By default there is no estimate for the reference level, but you're setting it to 1 as the reference level somewhere, which is technically correct. The reference level is assumed to be at 1, since by default the comparisons are to the reference level for categorical data.

You set terres_access to have the reference level be NO.

`terres_acces (param=ref ref='Non')`

PS. You do note need to set PARAM=REF for every variable you can include it at the end instead and it applies to all variables. If you have different parameterization methods for variables then you would need to set it individually.

`class <list of variables and reference levels> / param=ref;`

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@sebai wrote:

Actually, all my observations were used I have no missing data.

the OR should be more than 1, right !!?

You are describing a Prevalence Ratio.

Another link that may help: https://www.researchgate.net/post/Prevalence_Ratio_Odds_Ratio_and_Relative_Risk

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

How to Concatenate Values

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.