I am trying to set a reference variable for my linear regression model in R, however the ways I have tried to do so have failed. would anyone have any ideas on what to do next?
df_aas$nas_field <- relevel(df_aas$nas_field, ref = 1) # Apply relevel function
Error in relevel.default(df_aas$nas_field, ref = 1) :
'relevel' only for (unordered) factors
lm_nas <- lm(formula = c_ns2 ~ nas_field, data = df_aas) # reg with dummy var summary(lm_nas)
Note: outcome variable is continuous; predictors are character (see below):
 "phys_math_sci" "applied_bio_agr_env_sci" "biomed_sci" "bio_sci"
 "eng_applied_sci" "beh_social_sci"