全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
1593 1
2014-04-17
Dear All,

I would be grateful to you if you could help me with the following. I am getting desperate as I have to present my data on Wednesday.

I checked the linear assumption for my only continuous variable and it is violated.I used the natural logarithm. How can I check that now whether or not it is linear? Thank you in advance,

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-4-17 00:19:07
One straightforward way to get an idea about the functional relationship
between a continuous explanatory variable and the log-odds of an "event"
(with "event" being defined as Outcome variable = 1) is as follows:

1. For exploratory purposes only, recode the continuous variable into some
number of categories (e.g., quintiles).

2. Estimate a model with the categorical variable in place of the continuous
variable, and save the predicted probabilities.

3. Convert the predicted probabilities to predicted log-odds.

4. Make a scatterplot with X = the original continuous variable and Y =
predicted log-odds.

Here's an example from something I helped a colleague with a while ago.


* Model 1: Exploratory with categorical Age variable.

LOGISTIC REGRESSION VARIABLES Admission_status2
   /METHOD=ENTER AgeGroup Sex ED_only locum
   /CONTRAST (AgeGroup)=Indicator(1)
   /PRINT=CI(95)
   /SAVE pred(PP1)
   /CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).


COMPUTE LogOdds1 = ln(PP1 / (1 - PP1)).
VARIABLE LABELS LogOdds1 "Log-odds of outcome (Model 1)".
DESCRIPTIVES PP1 LogOdds1.

GRAPH /SCATTERPLOT(BIVAR)=AgeGroup WITH LogOdds1 .

* That scatter-plot shows a clear quadratic (U-shaped) relationship.
* Therefore, when we use Age as a continuous variable in Model 2,
* we'll want to include Age-squared as well.

* Model 2: Treat Age as a continuous variable,
* and include Age-squared.

COMPUTE AgeSq = Age**2.

LOGISTIC REGRESSION VARIABLES Admission_status2
   /METHOD=ENTER Age AgeSq Sex ED_only locum
   /PRINT=CI(95)
   /SAVE pred(PP2)
   /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5).

COMPUTE LogOdds2 = ln(PP2 / (1 - PP2)).
VARIABLE LABELS LogOdds2 "Log-odds of outcome (Model 2)".

HTH.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群