: Re: [R] [r] regression coefficient for different factors
From: dimitri.liakhovit...@gmail.com
To: nutini.france...@gmail.com
CC: rb...@atsu.edu; r-help@r-project.org
I think you don't need to write temp.data$a ~ temp.data$b just a ~ b
On Fri, May 20, 2011 at 11:45 AM, Francesco Nutini
Dear R-helpers,
In my dataset I have two continuous variable (A and B) and one factor.
I'm investigating the regression between the two variables usign the command
lm(A ~ B, ...)
but now I want to know the regression coefficient (r2) of A vs. B for every
factors.
I know that I can obtain this
--
From: Francesco Nutini nutini.france...@gmail.com
Sent: Friday, May 20, 2011 4:17 AM
To: [R] help r-help@r-project.org
Subject: [R] [r] regression coefficient for different factors
Dear R-helpers,
In my dataset I have two continuous variable (A and B
To: nutini.france...@gmail.com; r-help@r-project.org
Subject: Re: [R] [r] regression coefficient for different factors
Date: Fri, 20 May 2011 08:07:59 -0500
?summary
produces r^2 in 2nd to last line, as in,
set.seed(12); a=rnorm(100); b = runif(100); c = factor(rep(c('No',
'Yes'),50)); df
...@atsu.edu
To: nutini.france...@gmail.com; r-help@r-project.org
Subject: Re: [R] [r] regression coefficient for different factors
Date: Fri, 20 May 2011 08:07:59 -0500
?summary
produces r^2 in 2nd to last line, as in,
set.seed(12); a=rnorm(100); b = runif(100); c = factor(rep(c('No',
'Yes
nutini.france...@gmail.com wrote:
Yes Dimitri that's what I mean!
Something like this?
for(i in levels(c)) { lm(a ~ b * c , data=mydataset)}
And what about to see the output?
Thanks!
Date: Fri, 20 May 2011 09:46:08 -0400
Subject: Re: [R] [r] regression coefficient for different factors
From
=mydataset)}
And what about to see the output?
Thanks!
Date: Fri, 20 May 2011 09:46:08 -0400
Subject: Re: [R] [r] regression coefficient for different factors
From: dimitri.liakhovit...@gmail.com
To: nutini.france...@gmail.com
CC: rb...@atsu.edu; r-help@r-project.org
Francesco, do
-
project.org] On Behalf Of Francesco Nutini
Sent: Friday, May 20, 2011 3:18 AM
To: [R] help
Subject: [R] [r] regression coefficient for different factors
Dear R-helpers,
In my dataset I have two continuous variable (A and B) and one factor.
I'm investigating the regression between the two
in `[.data.frame`(mydataset, niger$site %in% i) :
undefined columns selected
Date: Fri, 20 May 2011 10:01:39 -0400
Subject: Re: [R] [r] regression coefficient for different factors
From: dimitri.liakhovit...@gmail.com
To: nutini.france...@gmail.com
CC: rb...@atsu.edu; r-help@r-project.org
First
: [R] [r] regression coefficient for different factors
From: dimitri.liakhovit...@gmail.com
To: nutini.france...@gmail.com
CC: rb...@atsu.edu; r-help@r-project.org
First you have to create something (e.g., a list) that holds your
output:
mylist-NULL
Then you loop through the levels of c and run
3.059960
Bill Venables
From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of
Francesco Nutini [nutini.france...@gmail.com]
Sent: 20 May 2011 19:17
To: [R] help
Subject: [R] [r] regression coefficient for different factors
Dear R
...@r-project.org [r-help-boun...@r-project.org] On Behalf
Of Francesco Nutini [nutini.france...@gmail.com]
Sent: 20 May 2011 19:17
To: [R] help
Subject: [R] [r] regression coefficient for different factors
Dear R-helpers,
In my dataset I have two continuous variable (A and B) and one factor
12 matches
Mail list logo