[R] Re: Tests in linear regression

Martin Maechler maechler at stat.math.ethz.ch
Sat Jan 1 12:54:47 CET 2000

>>>>> "FrSa" == SABIDO =?iso-8859-1?Q?MART=CDN?= <SABIDO> writes:

    FrSa> Hello. I am a student from Spain. We are working on 'R' (a
    FrSa> programming environment for data analysis and graphics). Our
    FrSa> teacher has told as to make a job about tests in non complet rank
    FrSa> linear regresion models (I hope you could understand this), and I
    FrSa> wonder if you could help us in any way (for example to find an
    FrSa> easy way to get the p-value (our test is b1=...=bq, where q is
    FrSa> less than number of parameters)). Anything you could do for us it
    FrSa> would be great. Thank you for everything, and merry christmas.
    FrSa> Best wishes, Francisco Sabido.

Dear Francisco,

I think everything you need is already part of R:

  summary(lm.sml <- lm(y ~ x1))
  summary(lm.big <- lm(y ~ x1 + x2 + x3 + x4))

  anova(lm.sml, lm.big)

now will do a test of   b2 = b3 = b4 = 0
if b_j is the coefficient of x_j.

Look at the online help  ?lm  and ?anova
and at 
where models "l1" and "l0" are compared that way.

---------- ---------- ----------
   Happy new year to everyone!
---------- ---------- ----------

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list