*Submit your homework to Canvas by the due date and time. Email your lecturer if you have extenuating circumstances and need to request an extension.

*If an exercise asks you to use R, include a copy of the code and output. Please edit your code and output to be only the relevant portions.

*If a problem does not specify how to compute the answer, you many use any appropriate method. I may ask you to use R or use manually calculations on your exams, so practice accordingly.

*You must include an explanation and/or intermediate calculations for an exercise to be complete.

*Be sure to submit the HWK1 Autograde Quiz which will give you ~20 of your 40 accuracy points.

*50 points total: 40 points accuracy, and 10 points completion

Basics of Statistics and Summarizing Data Numerically and Graphically (I)

Exercise 1. A number of individuals are interested in the proportion of citizens within a county who will vote to use tax money to upgrade a professional baseball stadium in the upcoming vote. Consider the following methods:

The Baseball Team Owner surveyed 8,000 people attending one of the baseball games held in the stadium. Seventy eight percent (78%) of respondents said they supported the use of tax money to upgrade the stadium.

The Pollster generated 1,000 random numbers between 1-52,661 (number of county voters in last election) and surveyed the 1,000 citizens who corresponded to those numbers on the voting roll. Forty three percent (43%) of respondents said they supported the use of tax money to upgrade the stadium.

  1. What is the population of interest? What is the parameter of interest? Will this parameter ever be calculated?

The population of interest is the votes of either Yes or No from county citizens that will vote in the next election. The parameter of interest is the number of people that vote yes to use the tax money to upgrade the stadium. The parameter will be calculated after all the votes are in.

  1. What were the sample sizes used and statistics calculated from those samples? Are these simple random samples from the population of interest?

There were two sample sizes used. One sample size was from a population of 8,000 people who attended the baseball game held in the stadium that may be upgraded and 78% of respondents said yes to using the tax money towards the stadium. The second sample size is 1,000 citizens who voted in the last election with 43% of respondents saying yes to using the tax money to upgrade the stadium. The first sample size from the baseball game is not a simple random sample because bias is present and it is not random. The second sample size may be a simple random sample because it utilizes a system that randomly chooses citizens who actively vote in the election with no bias present, however there is no guarantee that they will vote in the next election.

  1. The baseball team owner claims that the survey done at the baseball stadium will better predict the voting outcome because the sample size was much larger. What is your response?

I don’t think the voting outcome will be better because it will become more biased since the people voting are a better target audience for those in favor of upgrading the stadium. It wouldn’t be a better SRS either because of the bias present.

Exercise 2. There are 12 numbers in a sample, and the mean is \(\bar{x}=24\). The minimum of the sample is accidentally changed from 11.9 to 1.19.

  1. Is it possible to determine the direction in which (increase/decrease) the mean (\(\bar{x}\))changes? Or how much the mean changes? If so, by how much does it change? If not, why not?

Yes it is possible to determine the direction of the mean and how much it changes. Since the minimum value of the sample is decreased, the mean will also decrease. It decreases by 0.8925. This is calculated by finding the original sum of the range and then subtracting it by the change in the minimum value. Then taking the new sum of the range and dividing it by the number of samples, the new mean can be found. By subtracting the new mean \(\bar{x}=23.1075\) from the old mean \(\bar{x}=24\), the change is found to be a decrease of 0.8925.

  1. Is it possible to determine the direction in which the median changes? Or how much the median changes? If so, by how much does it change? If not, why not?

Yes, it is possible. However, the median doesn’t change since the range of values remains the same and the minimum value is the only value that changes. x = 0

  1. Is it possible to predict the direction in which the standard deviation changes? If so, does it get larger or smaller? If not, why not? Describe why it is difficult to predict by how much the standard deviation will change in this case.

Yes, the new value will be larger due to the large decrease of the minimum value. Since we don’t know the original standard deviation, we can’t calculate the new standard deviation.

Exercise 3: After manufacture, computer disks are tested for errors. The table below tabulates the number of errors detected on each of the 100 disks produced in a day.

Number of Defects Number of Disks
0 41
1 31
2 15
3 8
4 5
  1. Describe the type of data that is being recorded about the sample of 100 disks, being as specific as possible.

The type of data being recorded is quantitative-discrete data.

  1. A frequency histogram showing the number of errors on the 100 disks is given below. Write the R code to produce this frequency histogram. Be sure to create useful labels. Hints: use the rep() function to define your defect data. Also use ylim and breaks to format your graph.
disks.data=c(x = 0:4, y = 5:41)
disks.data=c(rep(0,41), rep(1, 31), rep(2, 15), rep(3, 8), rep(4, 5))
hist(disks.data, breaks=c(seq(from=-0.5, 4.5, by=1)), main="Number of Defects",labels=TRUE, ylim=c(0,50), xlab="Defects")

Defect Histogram
Defect Histogram
  1. What is the shape of the histogram for the number of defects observed in this sample? Why does that make sense in the context of the question?

Right skewed because there is a lower bound, but no upper bound.

  1. Calculate the mean and median number of errors detected on the 100 disks by hand and with R. How do the mean and median values compare and is that consistent with what we would guess based on the shape? [You can use LaTeX such as \(\bar{x}=\frac{value1}{value2}\) to help you show your work neatly.]

\(\bar{x}=\frac{(41 * 0) + (31 * 1) + (15 * 2) + (8 * 3) + (5 * 4)}{100} = 1.05\)

mean(disks.data)
## [1] 1.05
median(disks.data)
## [1] 1

The mean is 1.05 and the median is 1. The mean is greater than the median which is consistent with the right skew. The median is closer to the lower values because there is a higher frequency.

  1. Calculate the sample standard deviation ``by hand” and using R. Are the values consistent between the two methods? How would our calculation differ if instead we know that these 100 values were the whole population? [hint: use multiplication instead of repeated addition]

\(sd = \sqrt{\frac{41 * (0-1.05)^2 + 31 * (1-1.05)^2 + 15 * (2-1.05)^2 + 8*(3-1.05)^2 + 5 * (4-1.05)^2}{99}} = 1.157976\)

sd(disks.data)
## [1] 1.157976

Yes the values are consistent between the two methods. If we used the the entire population, it would be divided by 100 instead of 99 in the squared deviation and the values would not match.

  1. Construct a boxplot for the number of errors data using R with helpful labels. Explain how the shape of the data (identified in (c)) can be seen from the boxplot using words such as median and quartile.
boxplot(disks.data, horizontal=TRUE, xlab="Number of Defects")

The shape of the data is visible because it is a right skew since the Q1 is the minimum. The 2nd quartile is focused on the left side towards the lower values. The distance between Q3 and the max number of defects is also large because the Q3 is closer to to the lower values. The upper half of the data is more spread out because there are less values in the higher range of defects.

  1. Explain why the histogram is better able to show the discrete nature of the data than a boxplot.

The historgram is better able to show the discrete nature of the data because we can create specific bars for the frequency per defect. The box plot is poor in visualizing the number of defects on a certain amount of disks.