[R] Subject: Regress multiple independent variables on multiple dependent variables

Michael Friendly friendly at yorku.ca
Mon Nov 4 17:32:30 CET 2013

On 11/4/2013 9:18 AM, arun wrote:
> Hi,
> This gives an error.
> glm(cbind(O3, temp) ~ ., data=ozone)
> Error in x[good, , drop = FALSE] : (subscript) logical subscript too long
>   lm(cbind(O3, temp) ~ ., data=ozone) #works
Right.  With no family= specified, lm() is equivalent to what I meant. 
If this case was trapped,
the error message might have read
Error: glm() does not handle multiple responses with family=gaussian.  
Perhaps you meant to use lm()?

Michael Friendly     Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University      Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele Street    Web:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

More information about the R-help mailing list