我是R的新手。我正在尝试使用dwplot()命令绘制回归模型。
但是,结果图显示的估算值与模型摘要中的估算值不同。知道这怎么可能吗?
下面是我的代码。
#model for weight_birth
birth_wt<- subset(bball_new,select=c(weight_birth_pp,
maternal_age,
ethnicity,
smoking_antenatal,
marital_status,
highest_education,
occupational_status,
previous_births,
mode_delivery,
antenatal_multivits,
antenatal_iron,
antenatal_folicacid,
gdm_status,
prenatal_bmi,
net_wt_gain,
gestational_age,
infant_sex))
str(birth_wt)
birth_wt_no<-lm(weight_birth_pp~1, birth_wt)
birth_wt_all<-lm(weight_birth_pp~., birth_wt)
mod_birth_wt<-step(birth_wt_no, direction = "forward",formula(birth_wt_all))
summary(mod_birth_wt)
dwplot(mod_birth_wt)