


Reading scores in the dataset range from 30 to 80, so we choose that as our predictor range.

So, we need to choose a meaningful range of values of reading score to depict the slope. We are interested in plotting the slope of reading score in predicting math score for each gender. 399*write Step 2 Choose a range of predictor values across which we will estimate the slope We can write out the regression equation from this table: Here is the output table of model coefficients: Parameter Estimates Parameter Estimates, table, Dependent Variable, math score, 1 layers, 2 levels of column headers and 1 levels of row headers, table with 7 columns and 9 rows math score Parameter Because we want to use males (female=0) as the reference group, we entered female as a covariate rather than as a factor (which by default omits the last group). We used the glm procedure in SPSS to run our linear regression model. Step 1: Run the regression model to get model coefficients Our goal is to plot the slope of reading score for both genders. We will regress math score on reading score, female gender (a 0/1 variable), the interaction of reading score and gender, and the covariate writing score. We will use the hsbdemo (click to download) dataset. To demonstrate, we will run a linear regression model in SPSS and use the model coefficients from the output to generate predicted values of the outcome in Excel. For example, if we are using height and age as predictors of weight, and we want to display the effect of height on weight, we might fix age at its mean when predicting weight so that the effect of age does not interfere with the effect of height to be displayed. When we have covariates in addition to the predictors whose effect we would like to display, typically the covariates are fixed at certain values, such as the mean, when we predict the response to keep their effects constant (control for their effects). This is all that needs to be done if the regression model contains only one predictor. Typically the plot produced is a line plot. The general strategy for creating a display of the effect of a predictor in a regression model is to choose a range of values of the predictor over which we will estimate the predicted value of the response, and then to display the predictor on the x-axis and the predicted response on the y-axis.
Excel linear regression line software#
We will need to use the regression coefficients estimated from statistical software to transform sets of predictor values into predicted response values, all of which will then be plotted. In these cases we can create the graphs ourselves in Excel. At times, unfortunately, the statistical software used to estimate a regression model does not provide an easy way to visualize the effects involved in an interaction. Graphs of simple slopes are great aids in interpretation of interactions involving simple slopes.
