Hi, friends,
I have a dataset like this,
insheet using "https://stats.idre.ucla.edu/stat/data/hdp.csv", comma
foreach i of varlist familyhx smokinghx sex cancerstage school {
encode `i', gen(`i'2)
drop `i'
rename `i'2 `i'
}
ssc inst center,all replace
center co2 il6 crp lengthofstay
I want to fit a model as follows,
xtmelogit remission i.married c.c_il6 c.c_crp c.c_lengthofstay i.sex i.sex#c.cancerstage c.cancerstage c.c_co2 c.cancerstage#c.c_co2 c.cancerstage#c.cancerstage#c.c_co2 c.cancerstage#c.cancerstage#i.sex|| did:, intpoints(10) or
margins sex#married,post
I don't know why the results of the margins command above the predictive probabilities is not ranges from 0 to 1.
However, the attached snapshot about the predicted probabilities of a regular logit model ranges from 0-1.
. margins sex#married,post
Predictive margins Number of obs = 8,525
Expression: Linear prediction, fixed portion, predict(xb)
------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
sex#married |
female#0 | -1.484023 .1262418 -11.76 0.000 -1.731453 -1.236594
female#1 | -1.621055 .1231191 -13.17 0.000 -1.862364 -1.379746
male#0 | -1.423362 .1292779 -11.01 0.000 -1.676742 -1.169982
male#1 | -1.560394 .1263787 -12.35 0.000 -1.808091 -1.312696
------------------------------------------------------------------------------
Thank you for your help!
I have a dataset like this,
insheet using "https://stats.idre.ucla.edu/stat/data/hdp.csv", comma
foreach i of varlist familyhx smokinghx sex cancerstage school {
encode `i', gen(`i'2)
drop `i'
rename `i'2 `i'
}
ssc inst center,all replace
center co2 il6 crp lengthofstay
I want to fit a model as follows,
xtmelogit remission i.married c.c_il6 c.c_crp c.c_lengthofstay i.sex i.sex#c.cancerstage c.cancerstage c.c_co2 c.cancerstage#c.c_co2 c.cancerstage#c.cancerstage#c.c_co2 c.cancerstage#c.cancerstage#i.sex|| did:, intpoints(10) or
margins sex#married,post
I don't know why the results of the margins command above the predictive probabilities is not ranges from 0 to 1.
However, the attached snapshot about the predicted probabilities of a regular logit model ranges from 0-1.
. margins sex#married,post
Predictive margins Number of obs = 8,525
Expression: Linear prediction, fixed portion, predict(xb)
------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
sex#married |
female#0 | -1.484023 .1262418 -11.76 0.000 -1.731453 -1.236594
female#1 | -1.621055 .1231191 -13.17 0.000 -1.862364 -1.379746
male#0 | -1.423362 .1292779 -11.01 0.000 -1.676742 -1.169982
male#1 | -1.560394 .1263787 -12.35 0.000 -1.808091 -1.312696
------------------------------------------------------------------------------
Thank you for your help!
Comment