We can examine the overall effect of social class using the ‘test’ command. To specify which levels of the categorical n1171_2 social class variable we wish to compare to the reference category (‘I/II Prof & Managerial’), we include a prefix denoting the numeric code for each other category (e.g. ‘III Skilled non-manual’ is the second category so this is denoted as 2.n1171_2).
From the output of the ‘test’ command above, we can see that the overall effect of social class is statistically significant (p<.05).
We can also examine the differences in the coefficients for each of the different social classes compared to the reference category. For instance, we could again use the ‘test’ command, as shown in the example below, to evaluate whether the coefficient for social class ‘III Skilled non-manual’ is equivalent to the coefficient for social class ‘III Skilled manual’.
The output above shows that the p-value is under <.05 (our threshold for inferring statistical significance) and we can consequently say the coefficients for these two categories are different.
Focusing on our predictor of interest ‘general ability’, we can use predicted probabilities to help understand the relationship between general ability and obesity in the model. In this example we want to calculate the predicted probability of obesity for a given score on the general ability test. Predicted probabilities can be calculated using the ‘margins’ command. We can use this command to create the predicted probabilities for values of the general ability test (n920 which ranges from 0 to 79) from 10 to 80 in increments of 10. The ‘margins’ command uses the sample values of other predictor variables to calculate the average predicted probabilities on our predictor of interest. We can also use the ‘vsquish’ option in the command to help tidy up the output as this removes blank lines in output tables.
The first part of the output above tells us which row is associated with which general ability test score. Row 1 corresponds to a test score of 10, while row 8 is equal to a test score of 80. We can interpret from the table that as the test score at age 11 increases, the probability of obesity at age 42 is decreasing from 21.8% to 10.2%.
We can present the results as a graph by using the ‘marginsplot’ command, which plots both the predicted probabilities and their confidence intervals.
In the output plot above, the ‘predicted probability of obesity at age 42’ is on the Y axis and the ‘general ability test score at age 11’ is on the X axis. The fitted line decreases from left to right, indicating that as general ability scores increase, the probability of obesity decreases. The predicted probability of obesity at age 42 would be 17.8% with a test score of 30 at age 11, compared to 12.9% with a test score of 60.
The Learning Hub is a resource for students and educators
tel | +44 (0)20 7331 5102 |
---|---|
closer@ucl.ac.uk |
Sign up for our email newsletters to get the latest from CLOSER
Sign up