R

Asked • 10/12/19

How to force R to use a specified factor level as reference in a regression?

How can I tell R to use a certain level as reference if I use binary explanatory variables in a regression?It's just using some level by default. lm(x ~ y + as.factor(b)) with `b {0, 1, 2, 3, 4}`. Let's say I want to use 3 instead of the zero that is used by R.

1 Expert Answer

By:

Megan C. answered • 10/31/19

Tutor
New to Wyzant

Biostatistician, M.S.

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.