[R] MANCOVA in R

2014-11-19 Thread Michael
Hi,

I have two groups of persons, GRP0 and GRP1, on which I measured three
continuous variables: VAR1, VAR2 and VAR3.

I would like to use Mancova in R with:
- VAR1, VAR2 and VAR3 as outcome variables
- GRP={0,1} as predictor variable
- age and gender = {F,M} as covariates

What would be the correct way to formulate this model in R?

Also, since the VAR1, VAR2 and VAR3 measures were carried out on the
same persons at N=100 instances which were serially correlated, I
would like to apply permutation-based multiple-comparison correction
on the N=100 MANCOVA results I would obtain. Any help on this matter
as well would be fantastic.

Best wishes,

Michael

[[alternative HTML version deleted]]

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


[R] Mancova with R

2013-04-17 Thread Rémi Lesmerises
Dear all,

I'm trying to compare two sets of variables, the first set is composed 
exclusively of numerical variables and the second regroups factors and 
numerical variables. I can't use a Manova because of this inclusion of 
numerical variables in the second set. The solution should be to perform a 
Mancova, but I didn't find any package that allow this type of test.

I've already looked in this forum and on the net to find answers, but the only 
thing I've found is the following:


lm(as.matrix(Y) ~  x+z)
x and z could be numerical and factors. The problem with that is it actually 
only perform a succession of lm (or glm), one for each numerical variable 
contained in the Y matrix. It is not a true MANCOVA that do a significance test 
(most often a Wald test) for the overall two sets comparison. Such a test is 
available in SPSS and SAS, but I really want to stay in R! Someone have any 
idea?

Thanks in advance for your help!
 
Rémi Lesmerises, biol. M.Sc.,
Candidat Ph.D. en Biologie
Université du Québec à Rimouski
remilesmeri...@yahoo.ca

[[alternative HTML version deleted]]

__
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] Mancova with R

2013-04-17 Thread John Fox
Dear Remi,

Take a look at the Anova() function in the car package. In your case, you could 
use

Anova(lm(as.matrix(Y) ~  x + z))

or, for more detail,

summary(Anova(lm(as.matrix(Y) ~  x + z)))

I hope this helps,
 John


John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

On Wed, 17 Apr 2013 07:47:27 -0700 (PDT)
 Rémi Lesmerises remilesmeri...@yahoo.ca wrote:
 Dear all,
 
 I'm trying to compare two sets of variables, the first set is composed 
 exclusively of numerical variables and the second regroups factors and 
 numerical variables. I can't use a Manova because of this inclusion of 
 numerical variables in the second set. The solution should be to perform a 
 Mancova, but I didn't find any package that allow this type of test.
 
 I've already looked in this forum and on the net to find answers, but the 
 only thing I've found is the following:
 
 
 lm(as.matrix(Y) ~  x+z)
 x and z could be numerical and factors. The problem with that is it actually 
 only perform a succession of lm (or glm), one for each numerical variable 
 contained in the Y matrix. It is not a true MANCOVA that do a significance 
 test (most often a Wald test) for the overall two sets comparison. Such a 
 test is available in SPSS and SAS, but I really want to stay in R! Someone 
 have any idea?
 
 Thanks in advance for your help!
  
 Rémi Lesmerises, biol. M.Sc.,
 Candidat Ph.D. en Biologie
 Université du Québec à Rimouski
 remilesmeri...@yahoo.ca
 
   [[alternative HTML version deleted]]


__
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] Mancova with R

2013-04-17 Thread Rémi Lesmerises
Dear John,

Thanks for your comments! But when I tried your suggestion, the output was as 
the following:


 Response Dist_arbre :
            Df     Sum Sq    Mean Sq F value    Pr(F)    
Poids        1 0.00010398 0.00010398  6.2910 0.0364733 *  
Age          1 0.5202 0.5202  3.1476 0.1139652    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ 
’ 1 

I have the P-value but not the direction of the relationship, information that 
I had with  lm(as.matrix(Y) ~  x+z). I could combine the results of these 
two tests, but it seems inelegant to me. Moreover I didn't have a total 
significance test as with a true MANCOVA. 

An idea?!

Rémi Lesmerises, biol. M.Sc.,
Candidat Ph.D. en Biologie
Université du Québec à Rimouski
300, allée des Ursulines
remilesmeri...@yahoo.ca




 De : John Fox j...@mcmaster.ca
À : Rémi Lesmerises remilesmeri...@yahoo.ca 
Cc : r-help@r-project.org r-help@r-project.org 
Envoyé le : mercredi 17 avril 2013 10h54
Objet : Re: [R] Mancova with R


Dear Remi,

Take a look at the Anova() function in the car package. In your case, you could 
use

Anova(lm(as.matrix(Y) ~  x + z))

or, for more detail,

summary(Anova(lm(as.matrix(Y) ~  x + z)))

I hope this helps,
John


John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
    
On Wed, 17 Apr 2013 07:47:27 -0700 (PDT)
Rémi Lesmerises remilesmeri...@yahoo.ca wrote:
 Dear all,
 
 I'm trying to compare two sets of variables, the first set is composed 
 exclusively of numerical variables and the second regroups factors and 
 numerical variables. I can't use a Manova because of this inclusion of 
 numerical variables in the second set. The solution should be to perform a 
 Mancova, but I didn't find any package that allow this type of test.
 
 I've already looked in this forum and on the net to find answers, but the 
 only thing I've found is the following:
 
 
 lm(as.matrix(Y) ~  x+z)
 x and z could be numerical and factors. The problem with that is it actually 
 only perform a succession of lm (or glm), one for each numerical variable 
 contained in the Y matrix. It is not a true MANCOVA that do a significance 
 test (most often a Wald test) for the overall two sets comparison. Such a 
 test is available in SPSS and SAS, but I really want to stay in R! Someone 
 have any idea?
 
 Thanks in advance for your help!
  
 Rémi Lesmerises, biol. M.Sc.,
 Candidat Ph.D. en Biologie
 Université du Québec à Rimouski
 remilesmeri...@yahoo.ca
 
     [[alternative HTML version deleted]]
 
[[alternative HTML version deleted]]

__
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] Mancova with R

2013-04-17 Thread John Fox
Dear Remi,

On Wed, 17 Apr 2013 08:23:07 -0700 (PDT)
 Rémi Lesmerises remilesmeri...@yahoo.ca wrote:
 Dear John,
 
 Thanks for your comments! But when I tried your suggestion, the output was as 
 the following:
 
 
  Response Dist_arbre :
             Df     Sum Sq    Mean Sq F value    Pr(F)    
 Poids        1 0.00010398 0.00010398  6.2910 0.0364733 *  
 Age          1 0.5202 0.5202  3.1476 0.1139652    
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
 
 I have the P-value but not the direction of the relationship, information 
 that I had with  lm(as.matrix(Y) ~  x+z). I could combine the results of 
 these two tests, but it seems inelegant to me. Moreover I didn't have a total 
 significance test as with a true MANCOVA. 
 
 An idea?!

Yes, try what I suggested. The output that you show here isn't from the the 
Anova() function in the car package. As well, you might find it useful to read 
the on-line appendix on multivariate linear models, at 
http://socserv.socsci.mcmaster.ca/jfox/Books/Companion/appendix/Appendix-Multivariate-Linear-Models.pdf,
 from the book with which the car package is associated.

Best,
 John

 
 Rémi Lesmerises, biol. M.Sc.,
 Candidat Ph.D. en Biologie
 Université du Québec à Rimouski
 300, allée des Ursulines
 remilesmeri...@yahoo.ca
 
 
 
 
  De : John Fox j...@mcmaster.ca
 À : Rémi Lesmerises remilesmeri...@yahoo.ca 
 Cc : r-help@r-project.org r-help@r-project.org 
 Envoyé le : mercredi 17 avril 2013 10h54
 Objet : Re: [R] Mancova with R
  
 
 Dear Remi,
 
 Take a look at the Anova() function in the car package. In your case, you 
 could use
 
 Anova(lm(as.matrix(Y) ~  x + z))
 
 or, for more detail,
 
 summary(Anova(lm(as.matrix(Y) ~  x + z)))
 
 I hope this helps,
 John
 
 
 John Fox
 Sen. William McMaster Prof. of Social Statistics
 Department of Sociology
 McMaster University
 Hamilton, Ontario, Canada
 http://socserv.mcmaster.ca/jfox/
     
 On Wed, 17 Apr 2013 07:47:27 -0700 (PDT)
 Rémi Lesmerises remilesmeri...@yahoo.ca wrote:
  Dear all,
  
  I'm trying to compare two sets of variables, the first set is composed 
  exclusively of numerical variables and the second regroups factors and 
  numerical variables. I can't use a Manova because of this inclusion of 
  numerical variables in the second set. The solution should be to perform a 
  Mancova, but I didn't find any package that allow this type of test.
  
  I've already looked in this forum and on the net to find answers, but the 
  only thing I've found is the following:
  
  
  lm(as.matrix(Y) ~  x+z)
  x and z could be numerical and factors. The problem with that is it 
  actually only perform a succession of lm (or glm), one for each numerical 
  variable contained in the Y matrix. It is not a true MANCOVA that do a 
  significance test (most often a Wald test) for the overall two sets 
  comparison. Such a test is available in SPSS and SAS, but I really want to 
  stay in R! Someone have any idea?
  
  Thanks in advance for your help!
   
  Rémi Lesmerises, biol. M.Sc.,
  Candidat Ph.D. en Biologie
  Université du Québec à Rimouski
  remilesmeri...@yahoo.ca
  
      [[alternative HTML version deleted]]
  


John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

__
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] Mancova with R

2013-04-17 Thread peter dalgaard

On Apr 17, 2013, at 16:47 , Rémi Lesmerises wrote:

 Dear all,
 
 I'm trying to compare two sets of variables, the first set is composed 
 exclusively of numerical variables and the second regroups factors and 
 numerical variables. I can't use a Manova because of this inclusion of 
 numerical variables in the second set. The solution should be to perform a 
 Mancova, but I didn't find any package that allow this type of test.
 
 I've already looked in this forum and on the net to find answers, but the 
 only thing I've found is the following:
 
 
 lm(as.matrix(Y) ~  x+z)
 x and z could be numerical and factors. The problem with that is it actually 
 only perform a succession of lm (or glm), one for each numerical variable 
 contained in the Y matrix. It is not a true MANCOVA that do a significance 
 test (most often a Wald test) for the overall two sets comparison. Such a 
 test is available in SPSS and SAS, but I really want to stay in R! Someone 
 have any idea?

You can fit two models and compare them with (say)

fit1 - lm(as.matrix(Y) ~  x+z)
fit2 - lm(as.matrix(Y) ~  x)
anova(fit1, fit2, test=Wilks)

or, removing terms sequentially:

anova(fit1, test=Wilks)

 
 Thanks in advance for your help!
  
 Rémi Lesmerises, biol. M.Sc.,
 Candidat Ph.D. en Biologie
 Université du Québec à Rimouski
 remilesmeri...@yahoo.ca
 
   [[alternative HTML version deleted]]
 
 __
 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.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.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.


[R] MANCOVA in R

2008-05-08 Thread Bruno Estigarribia

Hello,

I have subjects in 4 groups: X1, X2, X3, X4. There are 33 subjects in 
group X1, 35 in X2, 31 in X3, and 46 in group X4. I have 7 continuous 
response variables (actually integers, approximately normal) measured 
for each subject: Y1 to Y7, and two continuous covariates C1, C2 (they 
are both integers).
I want to perform all pairwise comparisons for each response variable 
between groups. I have searched for a way to do a MANCOVA in R to no 
avail. I am familiar with summary.manova, and with Venables  Ripley 
Modern Applied Statistics With S and Everitt's An R and S-Plus 
Companion to Multivariate Analysis. However, I am neither a 
statistician nor a programmer so I am finding it hard to figure this 
out. Can summary.manova be adapted to use covariates? What is the impact 
of the unbalanced design? Can I adjust for multiple comparisons?

Thank you

Bruno Estigarribia
UNC Chapel Hill

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