[R] score test for logistic regression

peter dalgaard pdalgd at gmail.com
Sun Nov 14 18:40:41 CET 2010


On Nov 14, 2010, at 18:15 , David Winsemius wrote:

> 
> On Nov 14, 2010, at 11:29 AM, Wang, Ying wrote:
> 
>> Dear R experts,
>> 
>> I'm trying to find a code to calculate the p-value from the score test for the logistic regression. My fit is like this: logit=beta0+beta1*x1+beta2*x2 +....+ betak* xk. And my H0 is beta1=beta2=...=betak =0.
>> 
>> Any help will be highly appreciated. Thank you!
> 
> Which "score test" do you want?

That's actually pretty well-defined, David. 

The score test is based on calculating the "efficient scores", aka the derivative of the likelihood, at the MLE under the null hypothesis, and measuring it in the x'Ax sense, where A is the inverse expected Fisher information. It is very similar to the Wald test but things get evaluated under the null rather than the alternative. 

In GLM's with canonical links, there is a straightforward connection to the first weighted regression step taking you from the maximum under the null towards the maximum under the alternative.

Now, coercing R to generate the score tests is not _entirely_ trivial, since you need to pick glm()-related code and objects apart in exactly the right way, and I'm afraid that I don't know any pre-cooked codes for it. 

> 
> -- 
> David Winsemius, MD
> West Hartford, CT
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list