Lexi Kurszewski
Lexi Kurszewski

Reputation: 1

na.rm for a Linear Regression Model

I'm trying to run a linear regression model in R and I want to use na.rm to remove all my missing data. Is it possible to use na.rm here? If so where in the function do I put it? If not, what argument should I use instead?

My dataset is called dta and my variables are standardized. I've been trying to put na.rm after the object, but I honestly have no idea where it should be going or if it will work at all for this.

ex:

Model1 <- lm(dta$CTSO(dta$Year == 1997) ~ scale(dta$VM(dta$Year == 1997)) + scale(dta$AVMT(dta$Year == 1997)) + scale(dta$DDF1(dta$Year == 1997), na.rm = TRUE)

Upvotes: 0

Views: 433

Answers (0)

Related Questions