Use R studio to solve the following question. Just write down which code to use in R and show your understandment.
Young men in the United States were drafted for compulsory military service during the Vietnam War. A draft lottery was held on December 1, 1969 in which 366 capsules, each linked to a separate birthdate in 1952, were placed into a container. The capsules were drawn randomly, one by one. The order in which the capsules were drawn determined the order with which people with different birthdates were called for military service. The New York Times ran an article entitled “Statisticians Charge Draft Lottery Was Not Random” on January 4, 1970. According to this article, the capsules were placed into boxes by month before being placed into the container for random draws. The data containing the results from the 1970 draft lottery (“draft1970.csv”) is in the R Stuff folder on Courses. It is up to you to examine whether you think the 1970 Draft Lottery was fair.
a. Use your skills to examine whether the fact that the capsules were poured into the container by month affected the result of the draft. I recommend starting with a graphical plot to visualize the data. A boxplot with the data broken down by month might be a good one, but maybe something else is better. Be creative. I gave you sample code for visualization and descriptive statistics in the Lecture 7.R script saved in the R Stuff folder, including boxplot code among others.
b. A follow-up NYT article published in 1972 indicated that 63,500 men were called up for service during the 1970 draft—the top lottery number reached was 195, meaning no one with a lottery number of 196 or greater were called up for military service. Given this information, what proportion of birthdates in 1952 were drafted? There’s a variable in the dataset that may help you calculate this proportion as well.
c. Perform a one-sample hypothesis test to determine if the proportion with March birthdays selected for the draft was different from the proportion you calculated in part b at the 2% significance level. The table(df$var2, df$var1) command may be helpful here. As might the tapply(X=df$var1), INDEX=list(df$var2), FUN=length) command.
d. Use your inspection of the data to generate a two-sample hypothesis to test.
e. Do you think the 1970 draft lottery was fair? Provide supporting evidence for your opinion, including results from any statistical tests and graphical plots that support your claim.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.