

#I have got 3 dependent variables:

Y<-matrix(c(3,5,6,3,4,2,4,5,3,2,3,5,6,3,4,2,4,5,3,2,3,5,6,3,4,2,4,5,3,2), nrow = 10, ncol=3, byrow=TRUE)
#I've got one independent variable:

X<-matrix(c(42,54,67,76,45,76,54,87,34,65), nrow = 10, ncol=1, byrow=TRUE)
summary(lm(Y~X))


and the result is as below:
 Response Y1 :

Call:
lm(formula = Y1 ~ X)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.5040 -0.8838 -0.3960  1.1174  2.1162 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept)  4.43507    1.70369   2.603   0.0315 *
X           -0.01225    0.02742  -0.447   0.6668  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 1.401 on 8 degrees of freedom
Multiple R-squared: 0.02435,    Adjusted R-squared: -0.09761 
F-statistic: 0.1997 on 1 and 8 DF,  p-value: 0.6668 


Response Y2 :

Call:
lm(formula = Y2 ~ X)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.4680 -0.8437 -0.2193  0.9050  1.9960 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept)  1.37994    1.50111   0.919    0.385
X            0.03867    0.02416   1.601    0.148

Residual standard error: 1.235 on 8 degrees of freedom
Multiple R-squared: 0.2426,     Adjusted R-squared: 0.1479 
F-statistic: 2.562 on 1 and 8 DF,  p-value: 0.1481 


Response Y3 :

Call:
lm(formula = Y3 ~ X)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.7689 -0.7316 -0.1943  1.1448  2.0933 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept)  4.38913    1.70626   2.572    0.033 *
X           -0.01149    0.02746  -0.418    0.687  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 1.403 on 8 degrees of freedom
Multiple R-squared: 0.0214,     Adjusted R-squared: -0.1009 
F-statistic: 0.175 on 1 and 8 DF,  p-value: 0.6867 

 

There are 3 F statistics, R2 and p-values. But I want just one R2 and pvalue for my multivariate regression model. 

 

 

 

 

> Date: Fri, 4 Feb 2011 08:23:39 -0500
> From: jsorkin@grecc.umaryland.edu
> To: denizsigirli@hotmail.com; r-help@r-project.org
> Subject: Re: [R] multivariate regression
> 
> Please help us help you. Follow the posting rules and send us a copy of your code and output.
> John
> John Sorkin
> Chief Biostatistics and Informatics
> Univ. of Maryland School of Medicine
> Division of Gerontology and Geriatric Medicine
> JSorkin@grecc.umaryland.edu 
> -----Original Message-----
> From: Deniz SIGIRLI <denizsigirli@hotmail.com>
> To: <r-help@r-project.org>
> 
> Sent: 2/4/2011 7:54:56 AM
> Subject: [R] multivariate regression
> 
> 
> How can I run multivariate linear regression in R (I have got 3 dependent variables and only 1 independent variable)? I tried lm function, but it gave different R2 and p values for every dependent variable. I need one R2 and p value for the model. 
> [[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.
> 
> Confidentiality Statement:
> This email message, including any attachments, is for ...{{dropped:5}}

