Re: [R] Marginal effects from interaction regression model

2010-07-26 Thread David Winsemius


On Jul 25, 2010, at 11:47 PM, Guillem R. wrote:



As far as I know, the predict command gives the predicted values (and
intervals) of y, but what I'm looking for is the conditional effects  
(betas)

of x on y conditional on values of z.


If you want the betas, then simply print the object. Don't for get the  
default parameterization is for treatment effects.




I'm trying to produce a plot similar to the first shown in this link:
http://homepages.nyu.edu/~mrg217/interaction.html#code


If you want to provide an example  ...and  a more complete description  
of the desire output, I sure someone here can finish the job of  
showing you how setting up a call to predict will get you to that goal.


--
David.


Thanks again



David Winsemius wrote:



On Jul 25, 2010, at 10:24 PM, Guillem R. wrote:



Dear all,

I'd like to plot the marginal effect of a variable in a  
multiplicative

interaction regression, that is, the effect of a variable
conditional on the
values of another variable. As an illustration, given model lm1

lm1 - lm(y ~ x*z)


? predict

Perhaps:

predict(lm1, newdata=data.frame(x=1:10, z=5), interval=confidence)




I'd like to get the effects of x on y conditional on the values of
z, with
the corresponding confidence intervals if possible. Does anyone know
of any
package or simple way to do this?

Thanks


--

David Winsemius, MD
West Hartford, CT

__
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.




--
View this message in context: 
http://r.789695.n4.nabble.com/Marginal-effects-from-interaction-regression-model-tp2301858p2301884.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


David Winsemius, MD
West Hartford, CT

__
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.


Re: [R] Marginal effects from interaction regression model

2010-07-26 Thread Michael Friendly
The plots you are looking for are called 'effect plots'.  See the 
effects package by John Fox.


Guillem R. wrote:

As far as I know, the predict command gives the predicted values (and
intervals) of y, but what I'm looking for is the conditional effects (betas)
of x on y conditional on values of z.

I'm trying to produce a plot similar to the first shown in this link:
http://homepages.nyu.edu/~mrg217/interaction.html#code

Thanks again



David Winsemius wrote:


On Jul 25, 2010, at 10:24 PM, Guillem R. wrote:


Dear all,

I'd like to plot the marginal effect of a variable in a multiplicative
interaction regression, that is, the effect of a variable  
conditional on the

values of another variable. As an illustration, given model lm1

lm1 - lm(y ~ x*z)

? predict

Perhaps:

predict(lm1, newdata=data.frame(x=1:10, z=5), interval=confidence)


I'd like to get the effects of x on y conditional on the values of  
z, with
the corresponding confidence intervals if possible. Does anyone know  
of any

package or simple way to do this?

Thanks

--

David Winsemius, MD
West Hartford, CT

__
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.







--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

__
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.


Re: [R] Marginal effects from interaction regression model

2010-07-25 Thread David Winsemius


On Jul 25, 2010, at 10:24 PM, Guillem R. wrote:



Dear all,

I'd like to plot the marginal effect of a variable in a multiplicative
interaction regression, that is, the effect of a variable  
conditional on the

values of another variable. As an illustration, given model lm1

lm1 - lm(y ~ x*z)


? predict

Perhaps:

predict(lm1, newdata=data.frame(x=1:10, z=5), interval=confidence)




I'd like to get the effects of x on y conditional on the values of  
z, with
the corresponding confidence intervals if possible. Does anyone know  
of any

package or simple way to do this?

Thanks


--

David Winsemius, MD
West Hartford, CT

__
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.


Re: [R] Marginal effects from interaction regression model

2010-07-25 Thread Guillem R.

As far as I know, the predict command gives the predicted values (and
intervals) of y, but what I'm looking for is the conditional effects (betas)
of x on y conditional on values of z.

I'm trying to produce a plot similar to the first shown in this link:
http://homepages.nyu.edu/~mrg217/interaction.html#code

Thanks again



David Winsemius wrote:
 
 
 On Jul 25, 2010, at 10:24 PM, Guillem R. wrote:
 

 Dear all,

 I'd like to plot the marginal effect of a variable in a multiplicative
 interaction regression, that is, the effect of a variable  
 conditional on the
 values of another variable. As an illustration, given model lm1

 lm1 - lm(y ~ x*z)
 
 ? predict
 
 Perhaps:
 
 predict(lm1, newdata=data.frame(x=1:10, z=5), interval=confidence)
 
 

 I'd like to get the effects of x on y conditional on the values of  
 z, with
 the corresponding confidence intervals if possible. Does anyone know  
 of any
 package or simple way to do this?

 Thanks
 
 -- 
 
 David Winsemius, MD
 West Hartford, CT
 
 __
 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.
 
 

-- 
View this message in context: 
http://r.789695.n4.nabble.com/Marginal-effects-from-interaction-regression-model-tp2301858p2301884.html
Sent from the R help mailing list archive at Nabble.com.

__
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.