You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# It will be instructive to look at the mean of the dependent variable, write, for each level of race ((1 = Hispanic, 2 = Asian, 3 = African American and 4 = Caucasian)).
@@ -56,16 +64,24 @@
56
64
57
65
# <codecell>
58
66
67
+
hsb2.race.head(10)
68
+
69
+
# <codecell>
70
+
59
71
printcontrast.matrix[hsb2.race-1, :][:20]
60
72
73
+
# <codecell>
74
+
75
+
sm.categorical(hsb2.race.values)
76
+
61
77
# <rawcell>
62
78
63
79
# This is a bit of a trick, as the `race` category conveniently maps to zero-based indices. If it does not, this conversion happens under the hood, so this won't work in general but nonetheless is a useful exercise to fix ideas. The below illustrates the output using the three contrasts above
0 commit comments