m*****z 发帖数: 357 | 1 入门题目,比较初级,谢谢版上的各位先
在您bs俺的同时,顺便给俺解答下,俺不胜感谢。
刚才那个题目已经解了,我开始理解题意有点偏,谢谢楼下的解答
5个model
1)Y_ij = mu + epsilon_ij
2) Y_ij = mu_i + epsilon_ij
3)Y_ij = alpha + beta*X_ij + epsilon_ij
4) Y_ij = alpha_i + beta*X_ij + epsilon_ij
5) Y_ij = alpha_i + beta_i*X_ij + epsilon_ij
问R notaion for each model
Y - the response variable,
X - the continuous covariate
A - the discrete covariate
我的回答(不知道对错,2道做不出来。。。)
1)lm(Y~rep(mean(Y), length(Y)))
3) lm(Y~X)
4) lm(Y~X, A) | w********3 发帖数: 1503 | 2 2 is fixed effect;
3 is random intercept+fixed slope;
4 is random intercept+random slope. |
|