******************************************************************************* * Assignment 4 * BE SURE TO TYPE ALL COMMANDS YOU USE IN THIS DO FILE FOR FULL * CREDIT. * Write the answers to the questions in the commented-out space as indicated * Submit your do-file and word document (no log file needed) that includes * your final tables on the CLE by 1pm on 8/31/2021 * There are a total of 25 points in this assignment * _Your Name_: ******************************************************************************* /* Set your working directory and load the data */ version 17 clear capture log close *Set your working directory here: cd "Your/working/directory" *Open a new log here: log using "assignment4_log", replace *Load the nhanes2 dataset: webuse nhanes2 /* We will focus on one research question for this assignment: "Do people living // in rural areas of the US have higher blood systolic blood pressure /// compared to people living in non-rural areas?" We will practice making nice-looking tables in Stata and Word. Remember to include both the command(s) and your answer for each question. */ /* Question 1 (3 pts) Label the VALUES of "highbp" and "rural" according to their variable labels, /// and relabel the VARIABLES "highbp" to "High blood pressure" and "rural" to "Rural" Hint: check tab or codebook to see how the variables are labeled */ /* Question 2 (3 pts) Create a 2x2 table of the exposure ("rural") and the outcome ("highbp") /// using the tabulate command. Include options so you can see what percent of /// people had high blood pressure in each exposure group (add the col or row option, /// depending on how you set it up) __What percent of people in rural areas had high blood pressure?__ _Answer: __What percent of people in urban areas had high blood pressure?__ _Answer: */ *Put your command here: /* Question 3 (7 pts) Create a summary table of the mean values of the following variables for each /// category of the rural variable: age, bmi, systolic blood pressure, diastolic /// blood pressure, and highbp. Have the variables in rows and the statistics in /// columns as shown in class. Use putdocx to have STATA export the table directly /// into Word. Make sure the rows and columns are labeled. */ *Put your commands here: /* Question 4 (11 pts) Create a regression output table with 3 models: 1) Outcome: bpsystol; Predictors: rural 2) Outcome: bpsystol; Predictors: rural, age 3) Outcome: bpsystol; Predictors: rural, age, bmi Use estimates table. Export the table directly to your Word document using putdocx. Don't forget to make sure all the variables are labeled properly. */ *Put your commands here: /* Wrapping up and turning in the assignment (1 pt) */ *Turn in 2 files on the CLE: your do-file and your Word document *Close log here: log close