Virendra Mishra
2016-Feb-20 17:53 UTC
[R] Multivariate multiple linear regression question
Hi R-users, I have a fairly simple question to ask but I havent yet got an answer to the question. I will describe my experiment, analysis and what have I done and what is the question in the following paragraphs and I would appreciate if anyone could point me to use right statistical tools to answer my question. Experiment: I have 2 groups and both groups undergo 2 set of evaluations, one with MRI scanner and the other in the lab to test for their behavior. Both these evaluations are known to have statistically significant relationship with age and gender. Statistical question of interest: Whether there is: 1) statistically significant difference between the 2 groups on each evaluation ? 2) Whether there is any relationship between and within the 2 groups between each evaluation Model: I model the problem as following: MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group [Age is continuous and gender , Group are factors/categorical] Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group [Age is continuous and gender , Group are factors/categorical] In order to obtain the solution in R: MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group, data=data) Result of R: manova(MRI_model) suggests that yes indeed all the slopes are significantly different than 0 suggesting a relationship between my measures. Question: 1) In order to test whether the difference in the MRI_measure is statistically significant different between the 2 groups, I use MRI_model$fitted.values for each dependent measure and do a statistical test (either t-test or Wilcox) and claim that the difference is significant. In the paper I write, multivariate multiple linear regression was performed for the groups while controlling for age and gender. The regressed out MRI_measure was statistically compared to see if the difference is different. I am assuming that the predicted/fitted.values in model are the regressed out variables. Can I show this and use this result? Is this right If no, what is the correct way to statistically compare whether my 2 groups differ in their MRI measure and lab measure when controlled for age and gender. Any R library, literature, possibly a script will be greatly appreciated. 2) I also want to see if there is any relationship between MRI_measure and Lab_measure within the group after they are controlled for age and gender. What is the correct way to do this in R? Further, I also want to see if there is any significantly different association between the 2 groups for my set of dependent variables. I am thinking this can be done: I first find the correlation between 2 dependent variable in each group and test if this correlation is statistically different between the 2 groups? Is this logic right? And if it is, how do I compare the correlation? If not, what is the right way to do this? Any R library, literature, possibly a script will be greatly appreciated. I do appreciate any reply. Thanks Regards Virendra [[alternative HTML version deleted]]
Sorry, but please do not multiple post. That's spam. This is a list about the R programming language, not about statistical methods. While there is often some overlap, your questions are entirely statistical and therefore OT here( at least imo). Try a statistical list like stats.stackexchange.com instead. Cheers, Bert On Saturday, February 20, 2016, Virendra Mishra <virendra.mishra at gmail.com> wrote:> Hi R-users, > > I have a fairly simple question to ask but I havent yet got an answer to > the question. I will describe my experiment, analysis and what have I done > and what is the question in the following paragraphs and I would appreciate > if anyone could point me to use right statistical tools to answer my > question. > > Experiment: > I have 2 groups and both groups undergo 2 set of evaluations, one with MRI > scanner and the other in the lab to test for their behavior. Both these > evaluations are known to have statistically significant relationship with > age and gender. > > Statistical question of interest: > Whether there is: > 1) statistically significant difference between the 2 groups on each > evaluation ? > 2) Whether there is any relationship between and within the 2 groups > between each evaluation > > Model: > > I model the problem as following: > MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group > [Age is continuous and gender , Group are factors/categorical] > > Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group > [Age is continuous and gender , Group are factors/categorical] > > In order to obtain the solution in R: > MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group, > data=data) > > Result of R: > manova(MRI_model) suggests that yes indeed all the slopes are significantly > different than 0 suggesting a relationship between my measures. > > Question: > 1) In order to test whether the difference in the MRI_measure is > statistically significant different between the 2 groups, I use > MRI_model$fitted.values for each dependent measure and do a statistical > test (either t-test or Wilcox) and claim that the difference is > significant. > In the paper I write, multivariate multiple linear regression was performed > for the groups while controlling for age and gender. The regressed out > MRI_measure was statistically compared to see if the difference is > different. > > I am assuming that the predicted/fitted.values in model are the regressed > out variables. Can I show this and use this result? Is this right > > If no, what is the correct way to statistically compare whether my 2 groups > differ in their MRI measure and lab measure when controlled for age and > gender. Any R library, literature, possibly a script will be greatly > appreciated. > > 2) I also want to see if there is any relationship between MRI_measure and > Lab_measure within the group after they are controlled for age and gender. > What is the correct way to do this in R? > > Further, I also want to see if there is any significantly different > association between the 2 groups for my set of dependent variables. I am > thinking this can be done: I first find the correlation between 2 dependent > variable in each group and test if this correlation is statistically > different between the 2 groups? Is this logic right? And if it is, how do I > compare the correlation? If not, what is the right way to do this? Any R > library, literature, possibly a script will be greatly appreciated. > > I do appreciate any reply. > > Thanks > > Regards > > Virendra > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org <javascript:;> mailing list -- To UNSUBSCRIBE and > more, see > 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. >-- Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) [[alternative HTML version deleted]]
Virendra Mishra
2016-Feb-21 08:23 UTC
[R] Multivariate multiple linear regression question
Ok. Will do thank you. I do apologize for the spam. That was done in error. On Feb 21, 2016 12:10 AM, "Bert Gunter" <bgunter.4567 at gmail.com> wrote:> Sorry, but please do not multiple post. That's spam. > > This is a list about the R programming language, not about statistical > methods. While there is often some overlap, your questions are entirely > statistical and therefore OT here( at least imo). Try a statistical list > like stats.stackexchange.com instead. > > Cheers, > Bert > > > > On Saturday, February 20, 2016, Virendra Mishra <virendra.mishra at gmail.com> > wrote: > >> Hi R-users, >> >> I have a fairly simple question to ask but I havent yet got an answer to >> the question. I will describe my experiment, analysis and what have I done >> and what is the question in the following paragraphs and I would >> appreciate >> if anyone could point me to use right statistical tools to answer my >> question. >> >> Experiment: >> I have 2 groups and both groups undergo 2 set of evaluations, one with MRI >> scanner and the other in the lab to test for their behavior. Both these >> evaluations are known to have statistically significant relationship with >> age and gender. >> >> Statistical question of interest: >> Whether there is: >> 1) statistically significant difference between the 2 groups on each >> evaluation ? >> 2) Whether there is any relationship between and within the 2 groups >> between each evaluation >> >> Model: >> >> I model the problem as following: >> MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group >> [Age is continuous and gender , Group are factors/categorical] >> >> Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group >> [Age is continuous and gender , Group are factors/categorical] >> >> In order to obtain the solution in R: >> MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group, >> data=data) >> >> Result of R: >> manova(MRI_model) suggests that yes indeed all the slopes are >> significantly >> different than 0 suggesting a relationship between my measures. >> >> Question: >> 1) In order to test whether the difference in the MRI_measure is >> statistically significant different between the 2 groups, I use >> MRI_model$fitted.values for each dependent measure and do a statistical >> test (either t-test or Wilcox) and claim that the difference is >> significant. >> In the paper I write, multivariate multiple linear regression was >> performed >> for the groups while controlling for age and gender. The regressed out >> MRI_measure was statistically compared to see if the difference is >> different. >> >> I am assuming that the predicted/fitted.values in model are the regressed >> out variables. Can I show this and use this result? Is this right >> >> If no, what is the correct way to statistically compare whether my 2 >> groups >> differ in their MRI measure and lab measure when controlled for age and >> gender. Any R library, literature, possibly a script will be greatly >> appreciated. >> >> 2) I also want to see if there is any relationship between MRI_measure and >> Lab_measure within the group after they are controlled for age and gender. >> What is the correct way to do this in R? >> >> Further, I also want to see if there is any significantly different >> association between the 2 groups for my set of dependent variables. I am >> thinking this can be done: I first find the correlation between 2 >> dependent >> variable in each group and test if this correlation is statistically >> different between the 2 groups? Is this logic right? And if it is, how do >> I >> compare the correlation? If not, what is the right way to do this? Any R >> library, literature, possibly a script will be greatly appreciated. >> >> I do appreciate any reply. >> >> Thanks >> >> Regards >> >> Virendra >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> > > > -- > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > >[[alternative HTML version deleted]]
Michael Friendly
2016-Feb-22 13:38 UTC
[R] Multivariate multiple linear regression question
Hi Vivendra A few suggestions: * You will get more interpretable tests by using Type II (partial) tests of terms in your model via library(car) Manova(MRI_model) as opposed to the Type I (sequential) tests available from manova() * You will be able to understand the results better by making heplots via library(helplots) heplot(MRI_model) but you will have to read the associated vignettes to learn how to interpret them. * You can test for equality of covariance matrices in the various groups using heplots::boxM(), new in the development version on R-Forge install.packages("heplots", repos="http://R-Forge.R-project.org") library(helplots) res <- boxM(MRI_model, group=group) res plot(res) * You can visually assess the correlations in the groups using car::scatterplot(..., ellipse=TRUE, groups=) hope this is helpful, -Michael On 2/20/2016 12:53 PM, Virendra Mishra wrote:> Hi R-users, > > I have a fairly simple question to ask but I havent yet got an answer to > the question. I will describe my experiment, analysis and what have I done > and what is the question in the following paragraphs and I would appreciate > if anyone could point me to use right statistical tools to answer my > question. > > Experiment: > I have 2 groups and both groups undergo 2 set of evaluations, one with MRI > scanner and the other in the lab to test for their behavior. Both these > evaluations are known to have statistically significant relationship with > age and gender. > > Statistical question of interest: > Whether there is: > 1) statistically significant difference between the 2 groups on each > evaluation ? > 2) Whether there is any relationship between and within the 2 groups > between each evaluation > > Model: > > I model the problem as following: > MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group > [Age is continuous and gender , Group are factors/categorical] > > Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group > [Age is continuous and gender , Group are factors/categorical] > > In order to obtain the solution in R: > MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group, > data=data) > > Result of R: > manova(MRI_model) suggests that yes indeed all the slopes are significantly > different than 0 suggesting a relationship between my measures. > > Question: > 1) In order to test whether the difference in the MRI_measure is > statistically significant different between the 2 groups, I use > MRI_model$fitted.values for each dependent measure and do a statistical > test (either t-test or Wilcox) and claim that the difference is > significant. > In the paper I write, multivariate multiple linear regression was performed > for the groups while controlling for age and gender. The regressed out > MRI_measure was statistically compared to see if the difference is > different. > > I am assuming that the predicted/fitted.values in model are the regressed > out variables. Can I show this and use this result? Is this right > > If no, what is the correct way to statistically compare whether my 2 groups > differ in their MRI measure and lab measure when controlled for age and > gender. Any R library, literature, possibly a script will be greatly > appreciated. > > 2) I also want to see if there is any relationship between MRI_measure and > Lab_measure within the group after they are controlled for age and gender. > What is the correct way to do this in R? > > Further, I also want to see if there is any significantly different > association between the 2 groups for my set of dependent variables. I am > thinking this can be done: I first find the correlation between 2 dependent > variable in each group and test if this correlation is statistically > different between the 2 groups? Is this logic right? And if it is, how do I > compare the correlation? If not, what is the right way to do this? Any R > library, literature, possibly a script will be greatly appreciated. > > I do appreciate any reply. > > Thanks > > Regards > > Virendra > > [[alternative HTML version deleted]] >
Mishra, Virendra R
2016-Feb-22 15:00 UTC
[R] Multivariate multiple linear regression question
Thank you Michael for your suggestions. I will try them out and try to understand their interpretations. Regards Virendra Sent from Outlook Mobile<https://aka.ms/blhgte> On Mon, Feb 22, 2016 at 5:39 AM -0800, "Michael Friendly" <friendly at yorku.ca<mailto:friendly at yorku.ca>> wrote: Hi Vivendra A few suggestions: * You will get more interpretable tests by using Type II (partial) tests of terms in your model via library(car) Manova(MRI_model) as opposed to the Type I (sequential) tests available from manova() * You will be able to understand the results better by making heplots via library(helplots) heplot(MRI_model) but you will have to read the associated vignettes to learn how to interpret them. * You can test for equality of covariance matrices in the various groups using heplots::boxM(), new in the development version on R-Forge install.packages("heplots", repos="http://R-Forge.R-project.org") library(helplots) res <- boxM(MRI_model, group=group) res plot(res) * You can visually assess the correlations in the groups using car::scatterplot(..., ellipse=TRUE, groups=) hope this is helpful, -Michael On 2/20/2016 12:53 PM, Virendra Mishra wrote:> Hi R-users, > > I have a fairly simple question to ask but I havent yet got an answer to > the question. I will describe my experiment, analysis and what have I done > and what is the question in the following paragraphs and I would appreciate > if anyone could point me to use right statistical tools to answer my > question. > > Experiment: > I have 2 groups and both groups undergo 2 set of evaluations, one with MRI > scanner and the other in the lab to test for their behavior. Both these > evaluations are known to have statistically significant relationship with > age and gender. > > Statistical question of interest: > Whether there is: > 1) statistically significant difference between the 2 groups on each > evaluation ? > 2) Whether there is any relationship between and within the 2 groups > between each evaluation > > Model: > > I model the problem as following: > MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group > [Age is continuous and gender , Group are factors/categorical] > > Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group > [Age is continuous and gender , Group are factors/categorical] > > In order to obtain the solution in R: > MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group, > data=data) > > Result of R: > manova(MRI_model) suggests that yes indeed all the slopes are significantly > different than 0 suggesting a relationship between my measures. > > Question: > 1) In order to test whether the difference in the MRI_measure is > statistically significant different between the 2 groups, I use > MRI_model$fitted.values for each dependent measure and do a statistical > test (either t-test or Wilcox) and claim that the difference is > significant. > In the paper I write, multivariate multiple linear regression was performed > for the groups while controlling for age and gender. The regressed out > MRI_measure was statistically compared to see if the difference is > different. > > I am assuming that the predicted/fitted.values in model are the regressed > out variables. Can I show this and use this result? Is this right > > If no, what is the correct way to statistically compare whether my 2 groups > differ in their MRI measure and lab measure when controlled for age and > gender. Any R library, literature, possibly a script will be greatly > appreciated. > > 2) I also want to see if there is any relationship between MRI_measure and > Lab_measure within the group after they are controlled for age and gender. > What is the correct way to do this in R? > > Further, I also want to see if there is any significantly different > association between the 2 groups for my set of dependent variables. I am > thinking this can be done: I first find the correlation between 2 dependent > variable in each group and test if this correlation is statistically > different between the 2 groups? Is this logic right? And if it is, how do I > compare the correlation? If not, what is the right way to do this? Any R > library, literature, possibly a script will be greatly appreciated. > > I do appreciate any reply. > > Thanks > > Regards > > Virendra > > [[alternative HTML version deleted]] >______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. [[alternative HTML version deleted]]