# Help with lm function in rStudio

Hey, i need to do this and i dont know why in the last lm function it than says NA and NaN, i got a couple more of these to do, with the same problem. Do anyone know whats wrong or can help me solve this?
Thanks
Phorthax

``````WP1Aff <- c(9.333333333,
20.93333333,
25.66666667,
23,
22,
25.33333333,
19.33333333,
20.33333333,
23.66666667,
16
)

V1M <- c(15,15,15,15,14,14,14,14,14,14)
model <- lm(V1M ~ WP1Aff)
summary(model)
V1W <- c(12,12,12,12,12,12,12,12,12,12)
model <- lm(V1W ~ WP1Aff)
summary(model)

WP2Aff <- c(13.66666667,
21.6,
23.53333333,
21.83333333,
20.8,
19.8,
17.66666667,
28.2,
18.06666667,
16
)
V2M <- c(10,10,10,10,10,10,10,10,10,10)
model <- lm(V2M ~ WP2Aff)
summary(model)
V2W <- c(11,11,11,11,11,11,11,11,11,11)
model <- lm(V2W ~ WP2Aff)
summary(model)``````

V1W and V2M are constant. There's nothing to explain and you get a perfect fit.

But why do i get a summary by some and some not? shouldnt it be with NA through all?

I believe that internally something is basically trying to divide by zero. But computer arithmetic isn't perfect. So sometimes you get a meaningless number instead of NA.

So its more likely that the numbers im getting are wrong instead of everything else is wrong?

When the dependent variable is a constant you don't even need to run the regression to know the answer. The intercept is the value of the dependent variable and all the other coefficients are zero. The standard errors, t-statistics, etc., are meaningless.

well than thank you for your fast help i will need to look at it at a diffrent angle