What I want to do is make a condition if there is a certain variable in the linear model
Example. If B exists in the linear model
model <- lm(Y ~ A + B + C)
I want to do something. I used the summary function earlier to refer to the R-square.
summary(model)$r.squared
Maybe I'm looking for something like this
if (B %in% summary(model)$xxx)
or
if (B %in% summary(model)[xxx])
But I can not find xxx. Please help =)
source
share