ML Assignment 1: What makes teens have sex?
I was browsing the questionnaire topics and noticed that one was entitled, Motivations to Engage in Risky Behaviors. After opening that
Apologies about the size of the tree, you can right-click to view it in its own page and zoom and pan around. I trimmed it down to just 3 variables that seemed the most important following analysis of previous trees. The variables included were to what degree the respondent would feel guilty if they had sex (H1MO3), to what degree their mother would be upset if they had sex (H1M04), and to what degree they would “embarrass themselves” if they were/they got someone pregnant (H1MO10). The respondents are roughly evenly split between not having had sex (0) or having had it (1) (H1CO1).
For those who agree or strongly agree they would feel guilty if they had sex, 72% hadn’t had sex. Further branching by those who agree, or strongly agree they would be embarrassed by an accidental pregnancy 78% hadn’t had sex. And then of those who strongly agreed that their mothers would be upset, 84% hadn’t had sex.
Those who were uncertain about feeling guilty were roughly evenly split in who had had sex. For those who felt guilt-free about sex, 71% had had sex. Of these who were ambiguous or agreed they would be embarrassed in case of accidental pregnancy, 65% had had sex. On the other hand, 81% of those who wouldn’t feel embarrassed by accidental pregnancy had had sex.
The model classified 66% of the sample correctly, correctly identifying 64.5% of those who had not had sex, and 67.7% of those who had.
The code to produce this model is as follows:
Let me know what you think of this article on twitter @dumasraphael!