When I try to a linear regression model of my data and put in lm(DrinkDeath_1_1_~A1+A2+A3) I keep getting this: Error in model.frame.default(formula = DrinkDeath_1_1_ ~ A1, drop.unused.levels = TRUE) : invalid type (list) for variable 'DrinkDeath_1_1_' as an error message.
My linear model should be in this shape B = A1 * X1 + A2 * X2 + A3 * X3 and the names of the dataset are "Index" "A0" "A1" "A2" "A3" "A4" "B".
How can I make this linear regression?
DrinkDeath_1_1
is not of the right type. It should be a single numeric vector. Trystr(DrinkDeath_1_1)
PerhapsDrinkDeath_1_1 = as.numeric(DrinkDeath_1_1)
will help. $\endgroup$