I am trying to use the function cv.glm() from the boot package for validation of a linear model. first I run the model and it works fine:
> linear_model_red<-glm(red_wine_data$quality~.,data=red_wine_data)
then, I want to do the validation:
cv.glm(red_wine_data,linear_model_red)
and it fives me the error:
Error in model.frame.default(formula = red_wine_data$quality ~ ., data = list( :
variable lengths differ (found for 'fixed acidity')
I don't have any missing data at all, I checked. and also all of my variables are the same lengh:
sapply(red_wine_data,function(x) length(x))
fixed acidity volatile acidity
1599 1599
citric acid residual sugar
1599 1599
chlorides free sulfur dioxide
1599 1599
total sulfur dioxide density
1599 1599
pH sulphates
1599 1599
alcohol quality
1599 1599
volatile acidity*citric acid volatile acidity*sulphates
1599 1599
volatile acidity*alcohol citric acid*sulphates
1599 1599
citric acid*alcohol sulphates*alcohol
1599 1599
please help!