Question: In this assignment you will import an excel spreadsheet into R and calculate basic descriptive statistics for the data in the data set. 1. Import
In this assignment you will import an excel spreadsheet into R and calculate basic descriptive statistics for the data in the data set.
1. Import the homework data excel file into R
2.Transform the continuous variable (age) into categorical variable. The age groups are people under 25 and people older than age 25. Copy the table into your homework file and briefly interpret.
3. Redefined the categorical variable (SRB). These six different categories will be re-defined to 2 categories (have inappropriate sex behavior/ didn't have inappropriate sex behavior.
Redefined these six categories to 2 categories. 1 : Multiple sex partners 2: use condoms inconsistency 3: Unprotected intercourse without condom use 4: infected partner 5: Drug use 6: no
Copy the table into your homework file and briefly interpret.
4. Calculate the mean for the age by sexual risk behaviors variable. Copy the table into your homework file and briefly interpret.
5. Create a cross-tab showing the relationship between SRB variables and race/ethnicity variables. Copy the table into your homework file and briefly interpret.
| ID | race_eth | poc | ses | srb | age |
| 1 | 4 | 0 | 1 | 3 | 19 |
| 2 | 5 | 0 | 5 | 4 | 19 |
| 3 | 1 | 0 | 2 | 6 | 13 |
| 4 | 2 | 0 | 4 | 2 | 15 |
| 5 | 1 | 1 | 5 | 2 | 14 |
| 6 | 1 | 0 | 3 | 2 | 15 |
| 7 | 1 | 1 | 5 | 2 | 18 |
| 8 | 4 | 1 | 1 | 3 | 17 |
| 9 | 3 | 0 | 3 | 6 | 14 |
| 10 | 5 | 1 | 5 | 5 | 17 |
| 11 | 5 | 1 | 4 | 6 | 15 |
| 12 | 5 | 1 | 1 | 6 | 19 |
| 13 | 3 | 1 | 1 | 5 | 15 |
| 14 | 1 | 1 | 6 | 2 | 16 |
| 15 | 4 | 1 | 6 | 6 | 16 |
| 16 | 4 | 0 | 2 | 1 | 19 |
| 17 | 3 | 1 | 5 | 4 | 14 |
| 18 | 3 | 1 | 1 | 1 | 16 |
| 19 | 2 | 0 | 2 | 5 | 16 |
| 20 | 4 | 1 | 5 | 4 | 15 |
| 21 | 3 | 0 | 6 | 2 | 18 |
| 22 | 1 | 1 | 4 | 5 | 13 |
| 23 | 3 | 0 | 2 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| 63 | 1 | 1 | 3 | 6 | 14 |
| 64 | 3 | 1 | 4 | 5 | 13 |
| 65 | 2 | 1 | 5 | 3 | 19 |
| 66 | 2 | 1 | 2 | 6 | 16 |
| 67 | 5 | 0 | 2 | 1 | 15 |
| 68 | 1 | 0 | 5 | 6 | 16 |
| 69 | 5 | 1 | 6 | 3 | 13 |
| 70 | 2 | 1 | 6 | 3 | 17 |
| 71 | 2 | 1 | 2 | 4 | 15 |
| 72 | 3 | 0 | 5 | 5 | 15 |
| 73 | 4 | 1 | 1 | 2 | 13 |
| 74 | 2 | 1 | 3 | 6 | 19 |
| 75 | 4 | 1 | 5 | 5 | 17 |
| 76 | 1 | 0 | 2 | 1 | 18 |
| 77 | 2 | 0 | 1 | 6 | 19 |
| 78 | 4 | 0 | 1 | 6 | 15 |
| 79 | 5 | 1 | 1 | 3 | 14 |
| 80 | 2 | 1 | 5 | 4 | 14 |
| 81 | 2 | 0 | 2 | 6 | 16 |
| 82 | 1 | 0 | 2 | 2 | 14 |
| 83 | 2 | 0 | 6 | 1 | 18 |
| 84 | 5 | 1 | 1 | 5 | 19 |
| 85 | 5 | 1 | 4 | 1 | 13 |
| 86 | 1 | 0 | 3 | 4 | 19 |
| 87 | 4 | 1 | 5 | 6 | 15 |
| 88 | 3 | 1 | 1 | 3 | 16 |
| 89 | 4 | 1 | 6 | 3 | 17 |
| 90 | 4 | 0 | 5 | 5 | 16 |
| 91 | 5 | 0 | 5 | 4 | 13 |
| 92 | 5 | 0 | 4 | 2 | 16 |
| 93 | 3 | 1 | 2 | 2 | 14 |
| 94 | 4 | 1 | 5 | 1 | 19 |
| 95 | 3 | 0 | 5 | 1 | 16 |
| 96 | 2 | 1 | 2 | 5 | 18 |
| 97 | 1 | 0 | 6 | 1 | 17 |
| 98 | 2 | 1 | 2 | 1 | 14 |
| 99 | 4 | 1 | 4 | 3 | 16 |
| 100 | 4 | 0 | 4 | 4 | 17 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
