# Creating a regression model with a dependent variable, categorical variables and standardized independent variables

I have created a regression model that is centered around my dependent variable R.

I have a set of categorical variables and their interactions (days of week and shift [DAY/ NIGHT])

I have a set of independent variables that i have standardized so that their effect can be compared. Y

Q1: I would like to know if this is correct or if i should have standardized my dependent variable also?

Q2: when interpreting the coefficients for my independent variables is the coef an increase in R for 1 standard deviation of Y from 0? or from the mean of Y?

p.shape
xx=pd.get_dummies(data=p[['y1', 'y2', 'y3', 'Day','Shift', 'Terminal']]
,columns=['Day','Shift','Terminal']).drop(columns=['Day_Monday','Shift_Day','Terminal_L'])
xx['Intercept']=1
y = p['R']

from statsmodels.formula.api import ols
from statsmodels.regression.linear_model import OLS
# ols('R~Day_Friday+Day_Tuesday+Day_Wednesday+Day_Thursday+Day_Saturday+Day_Sunday+1',
#     data=pd.get_dummies(data=p,columns=['Day'])).fit().summary()
# xx.columns
xx.columns
xx['Shift_Nightx'+'Terminal_Tx']=xx['Shift_Night']*xx['Terminal_T']

for c in ['Day_Friday', 'Day_Saturday', 'Day_Sunday', 'Day_Thursday','Day_Tuesday', 'Day_Wednesday']:
xx['Shift_Nightx'+c]=xx['Shift_Night']*xx[c]
for c in ['Day_Friday', 'Day_Saturday', 'Day_Sunday', 'Day_Thursday','Day_Tuesday', 'Day_Wednesday']:
xx['Terminal_Tx'+c]=xx['Terminal_T']*xx[c]
for c in ['Day_Friday', 'Day_Saturday', 'Day_Sunday', 'Day_Thursday','Day_Tuesday', 'Day_Wednesday']:
xx['Shift_Nightx'+'Terminal_Tx'+c]=xx['Shift_Night']*xx['Terminal_T']*xx[c]

OLS(y,xx).fit().summary()
$$$$
`
• Could you explain in a bit more detail what do you mean by "a regression model that is centered around my dependent variable R"? Sep 20 '21 at 12:55

Both. You have standardized your independent variables $$y_1$$, $$y_2$$, and $$y_3$$ i.e. for each of them, you have subtracted the mean and divided by the standard deviation. This means that your standardized variables will have mean 0, so 1 standard deviation from 0 and 1 standard deviation from the mean are equivalent statements in this case.