Can you do linear regression with discrete variables?

Can you do linear regression with discrete variables?

If you have a discrete variable, you can decide whether to treat it as a continuous or categorical predictor. A discrete variable can be measured and ordered but it has a countable number of values. If you have one continuous predictor, you can use Simple Regression.

Can linear regression handle categorical variables?

Categorical variables require special attention in regression analysis because, unlike dichotomous or continuous variables, they cannot by entered into the regression equation just as they are. Instead, they need to be recoded into a series of variables which can then be entered into the regression model.

When to treat a discrete variable as categorical?

The decision to treat a discrete variable as continuous or categorical depends on the number of levels, as well as the purpose of the analysis. For more information, go to What are categorical, discrete, and continuous variables?.

Which is the explanatory variable in simple linear regression?

Simple linear regression is a statistical method that allows us to summarize and study relationships between two continuous (quantitative) variables: One variable, denoted x, is regarded as the predictor, explanatory, or independent variable. The other variable, denoted y, is regarded as the

How to create a regression with continuous variables?

Thus far in our study of statistical models we have been confined to building models between numeric (continuous) variables. yi =βxi +α+ϵi. y i = β x i + α + ϵ i. However, we don’t actually need to restrict our regression models to just numeric explanatory variables.

How to write a regression with a categorical variable?

Thus we could write our regression as: weighti =β1δF emale i +β2δM ale i +α w e i g h t i = β 1 δ i F e m a l e + β 2 δ i M a l e + α However, we will see that we only really need 1 (or generally N-1) indicator variable for our system. After all in our data set if you are NOT male then you must be female.