I'm conducting a multivariate multiple regression. As response variable, I have a function [ y(t) ] that I have discretized on a grid of 27 points, and 3 scalar regressors (x1,x2,x3). I have replaced the response function with an nxq (q=27) matrix Y and what I need to solve is:
Y = XB + E
where X [nxp (p=3)] is x1,x2,x3 column-stacked, B is a p×q matrix of regression coefficients and E is an n×q matrix of errors.
What I have done up to now is calling lm: mylm<-lm(Y ~ X)
which regresses each dependent variable separately on the predictors.
Now I want to determine whether a predictor jointly contributes to all the 27 models I get, but I don't know how to overcome the errors I get.
When I call Anova
this is what I get
Anova(mylm)
Error in eigen(qr.coef(if (repeated) qr(x$SSPE[[term]]) else SSPE.qr, :
infinite or missing values in 'x'
and, if for example, I want to test if x2 is statistically different from 0, I get the following
hyp =c(0,0,1,0)
rhs =rep(0,27)
lh.out <- linearHypothesis(mylm, hyp,rhs)
Error in linearHypothesis.mlm(mylm, hyp, rhs) :
The error SSP matrix is apparently of deficient rank = 25 < 27
If the problem is related to the non-singularity of a matrix, how can I ask to use the pseudoinverse?
EDIT--------------