turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Logistic regression

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-16-2018 02:51 PM

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 ??**

Accepted Solutions

Solution

05-16-2018
03:43 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sebai

05-16-2018 03:36 PM

@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;`

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sebai

05-16-2018 03:14 PM

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

05-16-2018 03:18 PM

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 !!?**

Solution

05-16-2018
03:43 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sebai

05-16-2018 03:36 PM

@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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sebai

05-16-2018 04:42 PM

@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