Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hint1: There are two ways to do this in R. You can manually create dummy variable columns; or use the factor(region) in the lm function:
Hint1: There are two ways to do this in R. You can manually create dummy variable columns; or use the factor(region) in the lm function: lm(Y~infection+factor(Region)+infection*factor(Region)). Although the factor() method can generate the summary for the full model quicky, it is not as flexible as the dummy variable method to evaluate the parameters in the model. Hint2: You may use the relevel() function in R to change the baseline category. For example, if you want to use the second, or the NE category as the baseline, do data$region<-relevel(data$region,2). This is useful when you are not comparing the mean response value of Y in a level to that in the baseline level
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started