S********a 发帖数: 359 | 1 如果有个变量 var1, 有四个值(categorical variable)分别是a,b,c,d,然后我run一个GLM model 1 如下,var2 和 var3也是categorical variables:
model y=var1 var2 var3;
我再把var1细分成4个dummy variables, 如果var1=a则 var1a=1, 否则var1a=0. var1b, var1c, var1d 同理,再run GLM model 2 如下:
model y=var1b var1c var1d var2 var3;
俩个model我都是用var1=a做reference group, 我可以说俩个model是等价的吗?如果可以,为什么STD ERROR,P-VALUE,还有代入同样变量值组合得到的Y不相等呢,虽然差的不太多。 | l*********s 发帖数: 5409 | 2 How did you get the first model to work in SAS? Amazing. | s*r 发帖数: 2757 | | S********a 发帖数: 359 | 4 model y=var1 var2 var3 /solution;
sorry for misleading you.
【在 l*********s 的大作中提到】 : How did you get the first model to work in SAS? Amazing.
| S********a 发帖数: 359 | 5 第二个模型里没有包括第一个dummy (var1a)
【在 s*r 的大作中提到】 : 3 dummies
| e****t 发帖数: 766 | 6 do you have missing when recoding ? | A*******s 发帖数: 3942 | 7 no class statement?
【在 S********a 的大作中提到】 : model y=var1 var2 var3 /solution; : sorry for misleading you.
| l*********s 发帖数: 5409 | 8 how are you certain SAS is using the first level of var1 as reference? By default the opposite is the case.
The coding schemes are all equivalent w.r.t linear transformation. As such,
the statistical characteristics won't change at all. But, the invariance
property is about the full model, not about individual parameters.You are
barking up the wrong tree here.
However, if your predictive estimates are different,even by a slight margin, you have very serious troubles, indicating your coding is wrong.
【在 S********a 的大作中提到】 : 第二个模型里没有包括第一个dummy (var1a)
| S********a 发帖数: 359 | 9 确实是一个missing捣的乱,太感谢了,现在两个模型的estimate一样了,接包子
【在 e****t 的大作中提到】 : do you have missing when recoding ?
| S********a 发帖数: 359 | 10 有,原贴没写
【在 A*******s 的大作中提到】 : no class statement?
| S********a 发帖数: 359 | 11 reference group可以任意指定,不一定非用sas default的那个,我的错误是在建
dummy variable的时候忽略了一个missing,造成slightly difference on estimate,
after correcting it, they are all the same. Thank you for your time. 包子奉
上。
default the opposite is the case.
,
margin, you have very serious troubles, indicating your coding is wrong.
【在 l*********s 的大作中提到】 : how are you certain SAS is using the first level of var1 as reference? By default the opposite is the case. : The coding schemes are all equivalent w.r.t linear transformation. As such, : the statistical characteristics won't change at all. But, the invariance : property is about the full model, not about individual parameters.You are : barking up the wrong tree here. : However, if your predictive estimates are different,even by a slight margin, you have very serious troubles, indicating your coding is wrong. :
|
|