'Regression Model in R

I want to run a regression model on a dichotomous variable in R. For example, in my data I have a variable that illustrates state failure, "1"= state failure "2" = no state failure. My dependent variable is the number of newly formed terrorist groups per country year coded from 0-11. How would I go about running a regression with the state failure variable? Would I have to create dummy variables if my data is already coded numerically, if so what would be the code to do this? Anything will help, thank you.



Solution 1:[1]

You don't need to create dummy variables. Your outcome variable is ordinal, but with 12 possible values, this is often simply treated as numeric, so I would start with lm(outcome ~ var) and inspect the residuals to assess whether this is a reasonable treatment. An alternative would be ordinal regression, such as MASS::polr()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1