Question: When I try to run the dot function with the residuals and regressor, I get an error that Conj(x) * y : non-conformable arrays. I

When I try to run the dot function with the residuals and regressor, I get an error that "Conj(x) * y : non-conformable arrays." I think its because during the regression (lm), couple of the rows are dropped due to empty data sets. How do I create a vector containing data used in the regression from each respective regressor, so I can perform the dot function?

Here is the relevant code

RegressP3 <- lm(earn~grade+ages+ageq,data=datatest) RegressP3 summary(RegressP3) #returns the R squared value anova(RegressP3) # TSS = RSS + ESS jtools :: summ (RegressP3) sum (RegressP3$residuals) yhat<-fitted (RegressP3)

dot(as.vector(RegressP3$residuals), as.vector(datatest$grade)) dot(as.vector(RegressP3$residuals), as.vector(datatest$ages)) dot(as.vector(RegressP3$residuals), as.vector(datatest$ageq))

ERROR: Error in Conj(x) * y : non-conformable arrays

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!