Thomas Levine
2009-Feb-01  14:27 UTC
[R] Putting all independent variables in one variable so performing many similar tests is more convenient
I want to do something like this. avo(q~a+b+c+d+e+f+g+h+i+j+k+l) avo(r~a+b+c+d+e+f+g+h+i+j+k+l) avo(s~a+b+c+d+e+f+g+h+i+j+k+l) (There's likely a better way to do this actually, but I think this'll work.) How do I define e=a+b+c+d+e+f+g+h+i+j+k+l such that the following works? avo(q~e) avo(r~e) avo(s~e) Tom
Thomas Levine
2009-Feb-01  14:27 UTC
[R] Putting all independent variables in one variable so performing many similar tests is more convenient
oops, I mean aov On Sun, Feb 1, 2009 at 9:27 AM, Thomas Levine <thomas.levine at gmail.com> wrote:> I want to do something like this. > > avo(q~a+b+c+d+e+f+g+h+i+j+k+l) > avo(r~a+b+c+d+e+f+g+h+i+j+k+l) > avo(s~a+b+c+d+e+f+g+h+i+j+k+l) > > (There's likely a better way to do this actually, but I think this'll work.) > > How do I define e=a+b+c+d+e+f+g+h+i+j+k+l such that the following works? > > avo(q~e) > avo(r~e) > avo(s~e) > > Tom >
Henrique Dallazuanna
2009-Feb-01  14:39 UTC
[R] Putting all independent variables in one variable so performing many similar tests is more convenient
Try this:
e <- as.formula(paste("q", paste(letters[1:12], collapse = " +
"), sep = " ~
"))
aov(e)
On Sun, Feb 1, 2009 at 12:27 PM, Thomas Levine
<thomas.levine@gmail.com>wrote:
> I want to do something like this.
>
> avo(q~a+b+c+d+e+f+g+h+i+j+k+l)
> avo(r~a+b+c+d+e+f+g+h+i+j+k+l)
> avo(s~a+b+c+d+e+f+g+h+i+j+k+l)
>
> (There's likely a better way to do this actually, but I think
this'll
> work.)
>
> How do I define e=a+b+c+d+e+f+g+h+i+j+k+l such that the following works?
>
> avo(q~e)
> avo(r~e)
> avo(s~e)
>
> Tom
>
> ______________________________________________
> R-help@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.
>
-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O
	[[alternative HTML version deleted]]
Gabor Grothendieck
2009-Feb-01  14:44 UTC
[R] Putting all independent variables in one variable so performing many similar tests is more convenient
Try: aov(yield ~., npk) On Sun, Feb 1, 2009 at 9:27 AM, Thomas Levine <thomas.levine at gmail.com> wrote:> I want to do something like this. > > avo(q~a+b+c+d+e+f+g+h+i+j+k+l) > avo(r~a+b+c+d+e+f+g+h+i+j+k+l) > avo(s~a+b+c+d+e+f+g+h+i+j+k+l) > > (There's likely a better way to do this actually, but I think this'll work.) > > How do I define e=a+b+c+d+e+f+g+h+i+j+k+l such that the following works? > > avo(q~e) > avo(r~e) > avo(s~e) > > Tom > > ______________________________________________ > 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. >