1Statistics 13Lab 3Professor: Mahtash EsfandiariThe objective of this lab is to:1) Allow you to construct side by side dotplots, boxplots, histograms, and interpret theresults.2) Make frequency tables (also referred to as contingency tables) of two categoricalvariables and interpret the results.3) Sort a data set by a categorical variable, construct, and compare histograms andboxplots for different levels of the categorical variable.Activity 1 for objective 1For objective 1 we will use the blood pressure dataset. This data set is about 15 patientswho take the same dose of a medication called catorpill and their systolic blood pressurewas measure before and after taking the medicine.Download this data set by typing:Command: infile before after usingwww.stat.ucla.edu/~rgould/datasets/bloodpressure.rawNotice that this data set is in "raw form" and not dta.1.1 Identify the variables of the study and indicate how you would classify them(continuous, discrete, categorical, or ordinal).1.2 Compare the distribution of the before and after drug systolic blood pressure by doinga side by side dotplot and boxplot.Command: dotplot var1 var2 (dotplot before after)graph var1 var2 box (graph before after, box)1.3 Based on the design used and the plots created, can you conclude the catropill is aneffective drug for lowering the blood pressure. Explain.Activity 2 objective 2For this part we will use a data set that was collected from Prof. Gould's Stats M12course in Spring 2000. Students were asked seven questions:1) Gender (m/f)2) Height (inches)3) Weight (pounds)4) Do you smoke? (yes == 1, no == 0)5) Who do you want for President? Bush, Gore, other.6) Rate your math ability: (1,2,3,4,5) 1 is much below average, 3 is average, 5 is muchabove average7) Rate your math anxiety; 1 is much below average, 3 is averageThe variable labels cannot be more than eight letters.2Download this data set from the Web:Command: use http://www.stat.ucla.edu/~rgould/datasets/m12s00.dtaNotice that his dataset is in the dta formWe want to build a frequency table for gender by president. Gender has two levels maleand female and president has three levels including Gore, Busch, and others. You canbuild this table by the following commands and answer the above questions based on thedata found. Notice that the table will also give you the missing data.Command: tabulate president gender, column row cell2.1 Use the resulting frequency table to answer the following questions:2.1.1 What is the proportion of women who will vote for Gore?2.1.2 Are women more likely to vote for Gore or Busch?2.1.3 Are men more likely to vote for Gore or women?2.1.4 Take the cells in the table and represent them as a sample space with anassociate probability distribution.2.2 Run the relevant analysis and answer the following questions:2.2.1 Given that the person is a female, what is the probability that she smokes.2.2.2 Do a tree diagram for the data as it is done on page 171 of the book.2.2.3 Can you conclude that smoking and gender are independent of each other?Explain.Activity 3 part 33.1 How does weight for men compare with weight for women? We will createside by side histograms to answer this question?For objective 3 we will use the same data sets that we used for objective 2. We want toanswer the following question:I order to do so, we need side by side histograms of weight for men and women. We firstneed to sort the data by gender and then create the relevant histograms.Command:sort gendergraph weight, histogram by (gender)You will notice that by default stata will give you a histogram with 5 bins. If you wantedto have 10 bins, you will change the following command as follows:Commands for creating histograms with 10 bins:sort gendergraph weight, histogram by(gender) bin(10)Command for creating the histogram for the whole group and by gender:sort gendergraph weight, histogram by(gender) bin(10) total33.2 How do men and women compare with respect to math anxiety? We will createside by side boxplots to answer this question:Commands:Sort by genderGraph mathanxi, box by (gender)Computer part of homework 3. Hand in the following along with the problemsassigned from the text for homework
View Full Document