Vivian Zhuang
2011-Jun-28 21:48 UTC
[R] a Weighted Least Square Model for a Binary Outcome
Dear R Users, I am new to the mailing list. I posted this message about two hours ago but did not receive it through the list, so I am posting it again. Sorry for duplicates. I would like to use R to fit a Weighted Least Square model for a binary outcome, say Y. The model is the one widely used for a binary dependent variable when the logistic model has not been proposed. Does anyone know how to specify the weight as the square root of 1/(E(Y)(1-E(Y)) in lm() or any other regression functions? I know that varPower() in the package of gls() can provide an optimal alpha estimator for a weight with the form of $E(Y)^{-2\alpha}$, which does not include the weight form I need. Please correct me if I am wrong. Thanks for any replies in advance! Best Regards, Vivian
Daniel Malter
2011-Jun-29 02:18 UTC
[R] a Weighted Least Square Model for a Binary Outcome
You can specify the weights=... argument in the lm() function as vector of weights, one for each observation. Should that not do what your are trying to do? HTH, Daniel -- View this message in context: http://r.789695.n4.nabble.com/a-Weighted-Least-Square-Model-for-a-Binary-Outcome-tp3631551p3631834.html Sent from the R help mailing list archive at Nabble.com.