Displaying 1 result from an estimated 1 matches for "pdepv".
Did you mean:
pdep
2003 Oct 01
1
question about predictions with linear models
...uestion is probably very obvious but I just cant see where I
might be going wrong.
I'm using the lm() function to generate a linear model and then make
predictions using a different set of data.
To generate the model I do (tdata & pdata are matrices of observations
and parameters, tdepv, pdepv are response vectors)
x <- as.data.frame(tdata)
x$tdepv <- tdepv
lnegth(tdepv) = 140
model <- lm(x$tdepv ~ x$V1 + x$V2 + x$V3 + x$V4, x)
pred <- predict(model, x)
length(pred) = 140
y <- as.data.frame(pdata)
y$pdepv <- pdepv
length(pdepv) = 16
pred <- predict(model, y)
len...