7 One-Sample Inference
Now that you have all this information about descriptive statistics and prob- abilities, it is time to start inferential statistics. There are two branches of inferential statistics: hypothesis testing and confidence intervals.
Hypothesis Testing: making a decision about a parameter(s) based on a statistic(s).
Confidence Interval: estimating a parameter(s) based on a statistic(s).
This chapter will describe hypothesis testing, but as was stated in Chapter 1, the American Statistical Association (ASA) is suggesting not discussing statis- tical significance and p-values. So this chapter is mostly for background to understand previously published studies.
Basics of Hypothesis Testing
To understand the process of a hypothesis tests, you need to first have an under- standing of what a hypothesis is, which is an educated guess about a parameter. Once you have the hypothesis, you collect data and use the data to make a determination to see if there is enough evidence to show that the hypothesis is true. However, in hypothesis testing you actually assume something else is true, and then you look at your data to see how likely it is to get an event that your data demonstrates with that assumption. If the event is very unusual, then you might think that your assumption is actually false. If you are able to say this assumption is false, then your hypothesis must be true. This is known as a proof by contradiction. You assume the opposite of your hypothesis is true and show that it can’t be true. If this happens, then your hypothesis must be true. All hypothesis tests go through the same process. Once you have the process down, then the concept is much easier. It is easier to see the process by looking at an example. Concepts that are needed will be detailed in this example.
215
Example: Basics of Hypothesis Testing
Suppose a manufacturer of the XJ35 battery claims the mean life of the battery is 500 days with a standard deviation of 25 days. You are the buyer of this battery and you think this claim is incorrect. You would like to test your belief because without a good reason you can’t get out of your contract.
Solution What do you do?
Well first, you should know what you are trying to measure. Define the random variable.
Let x = life of a XJ35 battery
Now you are not just trying to find different x values. You are trying to find what the true mean is. Since you are trying to find it, it must be unknown. You don’t think it is 500 days. If you did, you wouldn’t be doing any testing. The true mean, 𝜇, is unknown. That means you should define that too.
Let 𝜇 = mean life of a XJ35 battery Now what?
You may want to collect a sample. What kind of sample?
You could ask the manufacturers to give you batteries, but there is a chance that there could be some bias in the batteries they pick. To reduce the chance of bias, it is best to take a random sample.
How big should the sample be?
A sample of size 30 or more means that you can use the central limit theorem. Pick a sample of size 50.
Table #7.1.1 contains the data for the sample you collected:
Table #7.1.1: Data on Battery Life
Battery<- read.csv( “https://krkozak.github.io/MAT160/battery.csv”)head(Battery)
## |
life |
## |
1 491 |
## |
2 485 |
## |
3 503 |
## |
4 492 |
## |
5 482 |
## |
6 490 |
Now what should you do? Looking at the data set, you see some of the times are above 500 and some are below. But looking at all of the numbers is too difficult. It might be helpful to calculate the mean for this sample.
df_stats(~life, data=Battery, mean)
##mean_life ## 1490
The sample mean is 491.42 days. Looking at the sample mean, one might think that you are right. However, the standard deviation and the sample size also plays a role, so maybe you are wrong.
Before going any farther, it is time to formalize a few definitions.
You have a guess that the mean life of a battery is not 500 days. This is opposed to what the manufacturer claims. There really are two hypotheses, which are just guesses here – the one that the manufacturer claims and the one that you believe. It is helpful to have names for them.
Null Hypothesis: historical value, claim, or product specification. The symbol used is 𝐻𝑜.
𝐻𝑎𝐻1𝐻𝑎
Alternate Hypothesis: what you want to prove. This is what you want to accept as true when you reject the null hypothesis. There are two symbols that are commonly used for the alternative hypothesis:or. The symbol will be used in this book.
In general, the hypotheses look something like this:
𝐻0 ∶ 𝜇 = 𝜇𝑜
𝐻𝑎 ∶ 𝜇 ≠ 𝜇𝑜
𝜇𝑜
wherejust represents the value that the claim says the population mean is actually equal to.
𝐻𝑜
Also,can be less than, greater than, or not equal to, though not equal to is more common these days.
For this problem:
d𝐻a𝑜y∶s.𝜇 = 500𝑑𝑎𝑦𝑠, since the manufacturer says the mean life of a battery is 500
𝐻da𝑎ys∶ .𝜇 ≠ 500𝑑𝑎𝑦𝑠, since you believe that the mean life of the battery is not 500
Now back to the mean. You have a sample mean of 491.42 days. Is this different enough to believe that you are right and the manufacturer is wrong? How different does it have to be?
If you calculated a sample mean of 235 or 690, you would definitely believe the population mean is not 500. But even if you had a sample mean of 435 or 575 you would probably believe that the true mean was not 500. What about 475? or 535? Or 483? or 514? There is some point where you would stop being so sure that the population mean is not 500. That point separates the values of
where you are sure or pretty sure that the mean is not 500 from the area where you are not so sure. How do you find that point?
Well it depends on how much error you want to make. Of course you don’t want to make any errors, but unfortunately that is unavoidable in statistics. You need to figure out how much error you made with your sample. Take the sample mean, and find the probability of getting another sample mean less than it, assuming for the moment that the manufacturer is right. The idea behind this is that you want to know what is the chance that you could have come up with your sample mean even if the population mean really is 500 days.
Chances are probabilities. So you want to find the probability that the sample mean of 491.42 is unusual given that the population mean is really 500 days. To compute this probability, you need to know how the sample mean is distributed. Since the sample size is at least 30, then you know the sample mean is approxi- mately normally distributed. Now, you want to find the z-value. The z-value is
50
𝑧 = 491.4√225−500 = −2.43.
This is more than 2 standard deviations below the mean, so that seems that the sample mean is usual. It might be helpful to find the probability though. Since you are saying that the sample mean is different from 500 days, then you are asking if it is greater than or less than. This means that you are in the tails of the normal curve. So the probability you want to find is the probability being more than 2.43 or less than −2.43. This is 𝑃 (−2.43 < 𝑧) + 𝑃 (𝑧 > 2.43) = 0.015
pnorm(–2.43, 0, 1, lower.tail=TRUE)+pnorm(2.43, 0, 1, lower.tail=FALSE)
## [1] 0.01509882
So the probability of being in the tails is 0.015. This probability is known as a p-value for probability-value. This is unusual, so it is unlikely to get a sample mean of 491.42 if the population mean is 500 days.
So it appears the assumption that the population mean is 500 days is wrong, and you can reject the manufacturer’s claim.
But how do you quantify really small? Is 5% or 10% or 15% really small? How do you decide?
Before you answer that question, a couple more definitions are needed.

√
Test statistic: 𝑧 =
hypothesis
𝑥̄−𝜎𝜇𝑜
𝑛
since it is calculated as part of the testing of the
p – value: probability that the test statistic will take on more extreme values than the observed test statistic, given that the null hypothesis is true. It is the probability that was calculated above.
Now, how small is small enough? To answer that, you really want to know the types of errors you can make.
There are actually only two errors that can be made. The first error is if you say that is false, when in fact it is true. This means you reject when was true. The second error is if you say that is true, when in fact it is false. This means you fail to reject when is false. The following table organizes this for you:
Type of errors:
truefalse
RejectType I errorNo error
Fail to rejectNo errorType II error
Thus
Type I Error is rejecting 𝐻𝑜 when 𝐻𝑜 is true, and
Type II Error is failing to reject 𝐻𝑜 when is 𝐻𝑜 false.
Since these are the errors, then one can define the probabilities attached to each error.
𝛼= P(type I error) = P(rejecting 𝐻𝑜 given it is true)
𝛽= P(type II error) = P(failing to reject 𝐻𝑜 given it is false)
𝛼 is also called the level of significance.
Another common concept that is used is Power = 1 − 𝛽
𝛼𝛽
Now there is a relationship between and . They are not complements of each other. How are they related?
𝛼
𝛼𝛽
If increases that means the chances of making a type I error will increase. It is more likely that a type I error will occur. It makes sense that you are less likely to make type II errors, only because you will be rejecting more often. You will be failing to reject less, and therefore, the chance of making a type II error will decrease. Thus, as increases, will decrease, and vice versa. That makes them seem like complements, but they aren’t complements. What gives? Consider one more factor – sample size.
Consider if you have a larger sample that is representative of the population, then it makes sense that you have more accuracy then with a smaller sample. Think of it this way, which would you trust more, a sample mean of 490 if you had a sample size of 35 or sample size of 350 (assuming a representative sample)? Of course the 350 because there are more data points and so more accuracy. If you are more accurate, then there is less chance that you will make any error. By increasing the sample size of a representative sample, you decrease both 𝛼 and 𝛽.
Summary of all of this:
- For a certain sample size, n, if 𝛼 increases, 𝛽 decreases.
- For a certain level of significance, 𝛼, if n increases, 𝛽 decreases.
𝛼𝛽
𝛼𝛽𝛼
Now how do you find and ? Well is actually chosen. There are only two values that are usually picked for : 0.01 and 0.05. is very difficult to find , so usually it isn’t found. If you want to make sure it is small you take as large of a sample as you can afford provided it is a representative sample. This is one use of the Power. You want to be small and the Power of the test is large. The Power word sounds good.
𝛼
𝛼
Which pick of do you pick? Well that depends on what you are working on. Remember in this example you are the buyer who is trying to get out of a contract to buy these batteries. If you create a type I error, you said that the batteries are bad when they aren’t, most likely the manufacturer will sue you. You want to avoid this. You might pick to be 0.01. This way you have a small chance of making a type I error. Of course this means you have more of a chance of making a type II error. No big deal right? What if the batteries are used in pacemakers and you tell the person that their pacemaker’s batteries are good for 500 days when they actually last less, that might be bad. If you make a type II error, you say that the batteries do last 500 days when they last less, then you have the possibility of killing someone. You certainly do not want to do this. In this case you might want to pick 𝛼 as 0.05. If both errors are equally bad, then pick 𝛼 as 0.05.
The above discussion is why the choice of depends on what you are researching. As the researcher, you are the one that needs to decide what level to use based on your analysis of the consequences of making each error is.
If a type I error is really bad, then pick 𝛼= 0.01. If a type II error is really bad, then pick 𝛼= 0.05
𝛼
If neither error is bad, or both are equally bad, then pick 𝛼 = 0.05 Usually 𝛼 is picked to be 0.05 in most cases.
The main thing is to always pick the before you collect the data and start the test.
The above discussion was long, but it is really important information. If you don’t know what the errors of the test are about, then there really is no point in making conclusions with the tests. Make sure you understand what the two errors are and what the probabilities are for them.
Now it is time to go back to the example and put this all together. This is the basic structure of testing a hypothesis, usually called a hypothesis test. Since this one has a test statistic involving z, it is also called a z-test. And since there is only one sample, it is usually called a one-sample z-test.
Example: Battery Example Revisited.
- State the random variable and the parameter in words
x = life of battery
𝜇 = mean life of a XJ35 battery
- State the null and alternative hypothesis and the level of significance
𝐻𝑜 ∶ 𝜇 = 500
𝐻𝑎 ∶ 𝜇 ≠ 500
𝛼 = 0.05 (from above discussion about consequences)
- State and check the assumptions for a hypothesis test
Every hypothesis has some assumptions that be met to make sure that the results of the hypothesis are valid. The assumptions are different for each test. This test has the following assumptions.
- A random sample of size n is taken.
This occurred in this example, since it was stated that a random sample of 50 battery lives were taken.
- The population standard deviation is known. This is true, since it was given in the problem.
- The sample size is at least 30 or the population of the random variable is normally distributed.
The sample size was 30, so this condition is met.
- Find the sample statistic, test statistic, and p-value
The test statistic depends on how many samples there are, what parameter you are testing, and assumptions that need to be checked. In this case, there is one sample and you are testing the mean. The assumptions were checked above.
Sample statistic:
df_stats(~life, data=Battery, mean)
##mean_life ## 1490
𝑛
Test statistic: The z-value is 𝑧 = 491.4√225−400 = −2.43.
p-value: 𝑃 (−2.43 < 𝑧) + 𝑃 (𝑧 > 2.43) = 0.015
- Conclusion:
𝛼
Now what? Well, this p-value is 0.015. This is a lot smaller than the amount of error you would accept in the problem = 0.05. That means that finding a sample mean less than 490 days is unusual to happen if is true. This should make you think that is not true. You should reject 𝐻𝑜.
In fact, in general:
Reject 𝐻𝑜 if the p-value < 𝛼
Fail to reject 𝐻𝑜 if the p-value ≥ 𝛼.
6. Interpretation:
𝐻𝑜
Since you rejected , what does this mean in the real world? That it what goes in the interpretation. Since you rejected the claim by the manufacturer that the mean life of the batteries is 500 days, then you now can believe that your hypothesis was correct. In other words, there is enough evidence to support that the mean life of the battery is less than 500 days.
Now that you know that the batteries last less than 500 days, should you cancel the contract? Statistically, there is evidence that the batteries do not last as long as the manufacturer says they should. However, based on this sample there are only ten days less on average that the batteries last. There may not be practical significance in this case. Ten days do not seem like a large difference. In reality, if the batteries are used in pacemakers, then you would probably tell the patient to have the batteries replaced every year. You have a large buffer whether the batteries last 490 days or 500 days. It seems that it might not be worth it to break the contract over ten days. What if the 10 days was practically significant? Are there any other things you should consider? You might look at the business relationship with the manufacturer. You might also look at how much it would cost to find a new manufacturer. These are also questions to consider before making any changes. What this discussion should show you is that just because a hypothesis has statistical significance does not mean it has practical significance. The hypothesis test is just one part of a research process. There are other pieces that you need to consider.
That’s it. That is what a hypothesis test looks like. All hypothesis tests are done with the same six steps. Those general six steps are outlined below.
- State the random variable and the parameter in words. This is where you are defining what the unknowns are in this problem.
x = random variable
𝜇
= mean of random variable, if the parameter of interest is the mean. There are other parameters you can test, and you would use the appropriate symbol for that parameter.
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝜇 = 𝜇𝑜, where 𝜇𝑜 is the known mean
𝐻𝑎 ∶ 𝜇 ≠ 𝜇𝑜, You can replace ≠ with < or > but usually you use ≠
Also, state your level here.
- State and check the assumptions for a hypothesis test
Each hypothesis test has its own assumptions. They will be stated when the different hypothesis tests are discussed.
- Find the sample statistic, test statistic, and p-value
This depends on what parameter you are working with, how many samples, and the assumptions of the test. Technology will be used to find the sample statistic, test statistic, and p-value.
- Conclusion
This is where you write reject 𝐻𝑜 or fail to reject 𝐻𝑜. The rule is: if the p-value
< 𝛼, then reject 𝐻𝑜. If the p-value ≥ 𝛼, then fail to reject 𝐻𝑜
- Interpretation
This is where you interpret in real world terms the conclusion to the test. The conclusion for a hypothesis test is that you either have enough evidence to support 𝐻𝑎, or you do not have enough evidence to support 𝐻𝑎.
𝐻𝑜
𝐻𝑎
𝐻𝑎
𝐻𝑎
Sorry, one more concept about the conclusion and interpretation. First, the conclusion is that you reject or you fail to reject . Why was it said like this? It is because you never accept the null hypothesis. If you wanted to accept the null hypothesis, then why do the test in the first place? In the interpretation, you either have enough evidence to support , or you do not have enough evidence to support . You wouldn’t want to go to all this work and then find out you wanted to accept the claim. Why go through the trouble? You always want to have enough evidence to support the alternative hypothesis. Sometimes you can do that and sometimes you can’t. If you don’t have enough evidence to support , it doesn’t mean you support the null hypothesis; it just means you can’t support the alternative hypothesis. Here is an example to demonstrate this.
Example: Conclusions in Hypothesis Tests
In the U.S. court system a jury trial could be set up as a hypothesis test. To really help you see how this works, let’s use OJ Simpson as an example. In the court system, a person is presumed innocent until he/she is proven guilty, and this is your null hypothesis. OJ Simpson was a football player in the 1970s. In 1994 his ex-wife and her friend were killed. OJ Simpson was accused of the crime, and in 1995 the case was tried. The prosecutors wanted to prove OJ was guilty of killing his wife and her friend, and that is the alternative hypothesis. In this case, a verdict of not guilty was given. That does not mean that he is innocent of this crime. It means there was not enough evidence to prove he was guilty. Many people believe that OJ was guilty of this crime, but the jury did not feel that the evidence presented was enough to show there was guilt. The verdict in a jury trial is always guilty or not guilty!
The same is true in a hypothesis test. There is either enough or not enough evidence to support the alternative hypothesis. It is not that you proved the
null hypothesis true.
When identifying hypothesis, it is important to state your random variable and the appropriate parameter you want to make a decision about. If you count something, then the random variable is the number of whatever you counted. The parameter is the proportion of what you counted. If the random variable is something you measured, then the parameter is the mean of what you measured. (Note: there are other parameters you can calculate, and some analysis of those will be presented in later chapters.)
Example: Stating Hypotheses
Identify the hypotheses necessary to test the following statements:
- The average salary of a teacher is different from $30,000.
Solution:
x = salary of teacher
𝜇 = mean salary of teacher
The guess is that 𝜇 ≠ 30000 and that is the alternative hypothesis.
The null hypothesis has the same parameter and number with an equal sign.
𝐻𝑜 ∶ 𝜇 = 30000 𝐻𝑎 ∶ 𝜇 ≠ 30000
- The proportion of students who like math is not 10%.
Solution:
x = number of students who like math
p = proportion of students who like math
The guess is that p is not 0.10 and that is the alternative hypothesis. 𝐻𝑜 ∶ 𝑝 =
0.10 𝐻𝑎 ∶ 𝑝 ≠ 0.10
- The average age of students in this class differs from 21.
Solution:
x = age of students in this class
𝜇=mean age of students in this class
The guess is that 𝜇 ≠ 21 and that is the alternative hypothesis. 𝐻𝑜 ∶ 𝜇 = 21
𝐻𝑎 ∶ 𝜇 ≠ 21
Example: Stating Type I and II Errors and Picking Level of Significance
- The plant-breeding department at a major university developed a new hybrid raspberry plant called YumYum Berry. Based on research data, the
claim is made that from the time shoots are planted 90 days on average are required to obtain the first berry with a standard deviation of 9.2 days. A corporation that is interested in marketing the product tests 60 shoots by planting them and recording the number of days before each plant produces its first berry. The sample mean is 92.3 days. The corporation wants to know if the mean number of days is more than the 90 days claimed. State the type I and type II errors in terms of this problem, consequences of each error, and state which level of significance to use.
Solution:
x = time to first berry for YumYum Berry plant
= mean time to first berry for YumYum Berry plant
Type I Error: If the corporation does a type I error, then they will say that the plants take longer to produce than 90 days when they don’t. They probably will not want to market the plants if they think they will take longer. They will not market them even though in reality the plants do produce in 90 days. They may have loss of future earnings, but that is all.
Type II error: The corporation do not say that the plants take longer then 90 days to produce when they do take longer. Most likely they will market the plants. The plants will take longer, and so customers might get upset and then the company would get a bad reputation. This would be really bad for the company.
Level of significance: It appears that the corporation would not want to make a type II error. Pick a 5% level of significance, 𝛼 = 0.05.
- A concern was raised in Australia that the percentage of deaths of Abo- riginal prisoners was higher than the percent of deaths of non-indigenous prisoners, which is 0.27%. State the type I and type II errors in terms of this problem, consequences of each error, and state which level of signifi- cance to use.
Solution:
x = number of Aboriginal prisoners who have died
p = proportion of Aboriginal prisoners who have died
Type I error: Rejecting that the proportion of Aboriginal prisoners who died was 0.27%, when in fact it was 0.27%. This would mean you would say there is a problem when there isn’t one. You could anger the Aboriginal community, and spend time and energy researching something that isn’t a problem.
Type II error: Failing to reject that the proportion of Aboriginal prisoners who died was 0.27%, when in fact it is higher than 0.27%. This would mean that you wouldn’t think there was a problem with Aboriginal prisoners dying when there really is a problem. You risk causing deaths when there could be a way to avoid them.
Level of significance: It appears that both errors may be issues in this case. You wouldn’t want to anger the Aboriginal community when there isn’t an issue, and you wouldn’t want people to die when there may be a way to stop it. It may be best to pick a 5% level of significance, 𝛼 = 0.05.
Hint – hypothesis testing is really easy if you follow the same recipe every time. The only differences in the various problems are the assumptions of the test and the test statistic you calculate so you can find the p-value. Do the same steps, in the same order, with the same words, every time and these problems become very easy.
Homework
For the problems in this section, a question is being asked. This is to help you understand what the hypotheses are. You are not to run any hypothesis tests nor come up with any conclusions in this section.
- The Arizona Republic/Morrison/Cronkite News poll published on Mon- day, October 20, 2016, found 390 of the registered voters surveyed favor Proposition 205, which would legalize marijuana for adults. The statewide telephone poll surveyed 779 registered voters between Oct. 10 and Oct. 15. (Sanchez, 2016) Fifty-five percent of Colorado residents supported the le- galization of marijuana. Does the data provide evidence that the percent- age of Arizona residents who support legalization of marijuana is different from the proportion of Colorado residents who support it. State the ran- dom variable, population parameter, and hypotheses.
- According to the February 2008 Federal Trade Commission report on con- sumer fraud and identity theft, 23% of all complaints in 2007 were for identity theft. In that year, Alaska had 321 complaints of identity theft out of 1,432 consumer complaints (”Consumer fraud and,” 2008). Does this data provide enough evidence to show that Alaska had a different pro- portion of identity theft than 23%? State the random variable, population parameter, and hypotheses.
- The Kyoto Protocol was signed in 1997, and required countries to start re- ducing their carbon emissions. The protocol became enforceable in Febru- ary 2005. In 2004, the mean CO2 emission was 4.87 metric tons per capita. Is there enough evidence to show that the mean CO2 emission is different in 2010 than in 2004? State the random variable, population parameter, and hypotheses.
- The FDA regulates that fish that is consumed is allowed to contain 1.0 mg/kg of mercury. In Florida, bass fish were collected in 53 different lakes to measure the amount of mercury in the fish. Do the data provide enough evidence to show that the fish in Florida lakes has a different amount of mercury than the allowable amount? State the random variable, population parameter, and hypotheses.
- The Arizona Republic/Morrison/Cronkite News poll published on Mon- day, October 20, 2016, found 390 of the registered voters surveyed favor Proposition 205, which would legalize marijuana for adults. The statewide telephone poll surveyed 779 registered voters between Oct. 10 and Oct. 15. (Sanchez, 2016) Fifty-five percent of Colorado residents supported the le- galization of marijuana. Does the data provide evidence that the percent- age of Arizona residents who support legalization of marijuana is different from the proportion of Colorado residents who support it. State the type I and type II errors in this case, consequences of each error type for this situation from the perspective of the manufacturer, and the appropriate alpha level to use. State why you picked this alpha level.
- According to the February 2008 Federal Trade Commission report on con- sumer fraud and identity theft, 23% of all complaints in 2007 were for identity theft. In that year, Alaska had 321 complaints of identity theft out of 1,432 consumer complaints (”Consumer fraud and,” 2008). Does this data provide enough evidence to show that Alaska had a different proportion of identity theft than 23%? State the type I and type II errors in this case, consequences of each error type for this situation from the perspective of the state of Alaska, and the appropriate alpha level to use. State why you picked this alpha level.
- The Kyoto Protocol was signed in 1997, and required countries to start re- ducing their carbon emissions. The protocol became enforceable in Febru- ary 2005. In 2004, the mean CO2 emission was 4.87 metric tons per capita. Is there enough evidence to show that the mean CO2 emission is lower in 2010 than in 2004? State the type I and type II errors in this case, con- sequences of each error type for this situation from the perspective of the agency overseeing the protocol, and the appropriate alpha level to use. State why you picked this alpha level.
- The FDA regulates that fish that is consumed is allowed to contain 1.0 mg/kg of mercury. In Florida, bass fish were collected in 53 different lakes to measure the amount of mercury in the fish. Do the data provide enough evidence to show that the fish in Florida lakes has different amount of mercury than the allowable amount? State the type I and type II errors in this case, consequences of each error type for this situation from the perspective of the FDA, and the appropriate alpha level to use. State why you picked this alpha level.
One-Sample Proportion Test
There are many different parameters that you can test. There is a test for the mean, such as was introduced with the z-test. There is also a test for the
population proportion, p. This is where you might be curious if the proportion of students who smoke at your school is lower than the proportion in your area. Or you could question if the proportion of accidents caused by teenage drivers who do not have a drivers’ education class is more than the national proportion.
𝜋
𝑝̂
𝑝̂
To test a population proportion, there are a few things that need to be defined first. Usually, Greek letters are used for parameters and Latin letters for statis- tics. When talking about proportions, it makes sense to use p for proportion. The Greek letter for p is , but that is too confusing to use. Instead, it is best to use p for the population proportion. That means that a different symbol is needed for the sample proportion. The convention is to use, , known as p-hat. This way you know that p is the population proportion, and that is the sample proportion related to it.
Now proportion tests are about looking for the percentage of individuals who have a particular attribute. You are really looking for the number of successes that happen. Thus, a proportion test involves a binomial distribution.
Hypothesis Test for One Population Proportion (1-Prop Test)
- State the random variable and the parameter in words. x = number of successes
p = proportion of successes
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝑝 = 𝑝𝑜, where 𝑝𝑜 is the known proportion
𝐻𝑎 ∶ 𝑝 ≠ 𝑝𝑜, you can also use < or >, but ≠ is the more common one to use. Also, state your 𝛼 level here.
- State and check the assumptions for a hypothesis test
- State: A simple random sample of size n is taken. Check: describe how the sample was collected
- State: The conditions for the binomial experiment are satisfied. Check: Show all four properties are true.
𝑝̂
𝑝 ∗ 𝑛 ≥ 5𝑞 ∗ 𝑛 ≥ 5𝑞 = 1 − 𝑝
𝑝̂
State: The sampling distribution of is normally distributed. Check: you need to show thatand, where. If this require- ment is true, then the sampling distribution of is well approximated by a normal curve.- Find the sample statistic, test statistic, and p-value This will be computed on R Studio using the command
prop.test(r, n, p=what Ho says)
where r=observed number of successes and n = number of trials.
- Conclusion
This is where you write reject or fail to reject 𝐻𝑜. The rule is: if the p-value
< 𝛼 , then reject 𝐻0. If the p-value ≥ 𝛼, then fail to reject 𝐻𝑜
- Interpretation
This is where you interpret in real world terms the conclusion to the test. The conclusion for a hypothesis test is that you either have enough evidence to support 𝐻𝑎, or you do not have enough evidence to support 𝐻𝑎.
Example: Hypothesis Test for One Proportion
A concern was raised in Australia that the percentage of deaths of Aboriginal prisoners was different than the percent of deaths of non-Aboriginal prisoners, which is 0.27%. A sample of six years (1990-1995) of data was collected, and it was found that out of 14,495 Aboriginal prisoners, 51 died (”Indigenous deaths in,” 1996). Do the data provide enough evidence to show that the proportion of deaths of Aboriginal prisoners is different from 0.27%?
Solution:
- State the random variable and the parameter in words.
x = number of Aboriginal prisoners who die
p = proportion of Aboriginal prisoners who die
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝑝 = 0.0027
𝐻𝑎 ∶ 𝑝 ≠ 0.0027
From Example #7.1.5, the argument was made to pick 5% for the level of significance. So 𝛼 = 0.05
- State and check the assumptions for a hypothesis test
- A simple random sample of 14,495 Aboriginal prisoners was taken. Check: The sample was not a random sample, since it was data from six years. It is the numbers for all prisoners in these six years, but the six years were not picked at random. Unless there was something special about the six years that were chosen, the sample is probably a representative sample. This assumption is probably met.
- The properties of a binomial experiment are met. There are 14,495 prison- ers in this case. Check: The prisoners are all Aboriginals, so you are not mixing Aboriginal with non-Aboriginal prisoners. There are only two out- comes, either the prisoner dies or doesn’t. The chance that one prisoner dies over another may not be constant, but if you consider all prisoners the same, then it may be close to the same probability. Thus the conditions for the binomial distribution are satisfied
distributed.
The sampling distribution of 𝑝̂ can be approximated with a normal dis- tributed. Check: In this case p = 0.0027 and n = 14,495. 𝑛∗𝑝 = 39.1365 ≥ 5 and 𝑛∗𝑞 = 14455.86 ≥ 5. So, the sampling distribution for 𝑝̂ is normally
- Find the sample statistic, test statistic, and p-value Use the following command in R Studio:
prop.test(51, 14495, p=0.0027)
##
## 1-sample proportions test with continuity correction ##
## data: 51 out of 14495
## X-squared = 3.3084, df = 1, p-value = 0.06893
## alternative hypothesis: true p is not equal to 0.0027 ## 95 percent confidence interval:
## 0.002647440 0.004661881
## sample estimates:
##p
## 0.003518455
Sample Proportion: 𝑝̂ = 0.0035
Test Statistic: 𝜒2 = 3.3085
p-value: 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.06893
- Conclusion
Since the 𝑝 − 𝑣𝑎𝑙𝑢𝑒 ≥ 0.05, then fail to reject 𝐻𝑜.
- Interpretation
There is not enough evidence to support that the proportion of deaths of Abo- riginal prisoners is different from non-Aboriginal prisoners.
Example: Hypothesis Test for One Proportion
A researcher who is studying the effects of income levels on breastfeeding of infants hypothesizes that countries with a low income level have a different rate of infant breastfeeding than higher income countries. It is known that in Germany, considered a high-income country by the World Bank, 22% of all babies are breastfeed. In Tajikistan, considered a low-income country by the World Bank, researchers found that in a random sample of 500 new mothers that 125 were breastfeeding their infant. At the 5% level of significance, does this show that low-income countries have a different incident of breastfeeding?
Solution:
- State you random variable and the parameter in words.
x = number of woman who breastfeed in a low-income country
p = proportion of woman who breastfeed in a low-income country
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝑝 = 0.22
𝐻𝑎 ∶ 𝑝 ≠ 0.22
𝛼 = 0.05
- State and check the assumptions for a hypothesis test
- A simple random sample of 500 breastfeeding habits of woman in a low- income country was taken. Check: This was stated in the problem.
- The properties of a Binomial Experiment have been met. Check: There were 500 women in the study. The women are considered identical, though they probably have some differences. There are only two outcomes, either the woman breastfeeds or she doesn’t. The probability of a woman breast- feeding is probably not the same for each woman, but it is probably not very different for each woman. The conditions for the binomial distribu- tion are satisfied
𝑛 ∗ 𝑞 = 390 ≥ 5𝑝̂
𝑛 ∗ 𝑝 = 110 ≥ 5
𝑝̂
The sampling distribution ofcan be approximated with a normal dis- tributed. Check: In this case, n = 500 and p = 0.22.and
, so the sampling distribution ofis well approximated by a normal curve.
- Find the sample statistic, test statistic, and p-value On R studio, use the following command
prop_test(125, 500, p=0.22)
##
## 1-sample proportions test with continuity correction ##
## data: 125 out of 500
## X-squared = 2.4505, df = 1, p-value = 0.1175
## alternative hypothesis: true p is not equal to 0.22 ## 95 percent confidence interval:
## 0.2131062 0.2908059
## sample estimates:
##p
## 0.25
Sample Statistic: 𝑝̂ = 0.25 test Statistic: 𝜒2 = 2.4505 p-value: 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.1175
- Conclusion
Since the p-value is more than 0.05, you fail to reject 𝐻𝑜.
- Interpretation
There is not enough evidence to support that the proportion of women who breastfeed in low-income countries is different from the proportion of women in high-income countries who breastfeed.
𝐻𝑜
𝐻𝑜
𝐻𝑎
Notice, the conclusion is that there wasn’t enough evidence to support . The conclusion was not that you support . There are many reasons why you can’t say that is true. It could be that the countries you chose were not very representative of what truly happens. If you instead looked at all high-income countries and compared them to low-income countries, you might have different results. It could also be that the sample you collected in the low-income country was not representative. It could also be that income level is not an indication of breastfeeding habits. It could be that the sample that was taken didn’t show evidence but another sample would show evidence. There could be other factors involved. This is why you can’t say that you support 𝐻𝑜. There are too many other factors that could be the reason that you failed to reject 𝐻0.
Homework
In each problem show all steps of the hypothesis test. If some of the assumptions are not met, note that the results of the test may not be correct and then continue the process of the hypothesis test.
- The Arizona Republic/Morrison/Cronkite News poll published on Mon- day, October 20, 2016, found 390 of the registered voters surveyed favor Proposition 205, which would legalize marijuana for adults. The statewide telephone poll surveyed 779 registered voters between Oct. 10 and Oct. 15. (Sanchez, 2016) Fifty-five percent of Colorado residents supported the le- galization of marijuana. Does the data provide evidence that the percent- age of Arizona residents who support legalization of marijuana is different from the proportion of Colorado residents who support it. Test at the 1% level.
- In July of 1997, Australians were asked if they thought unemployment would increase, and 47% thought that it would increase. In November of 1997, they were asked again. At that time 284 out of 631 said that they thought unemployment would increase (”Morgan Gallup poll,” 2013). At the 5% level, is there enough evidence to show that the proportion of Australians in November 1997 who believe unemployment would increase is different from the proportion who felt it would increase in July 1997?
- According to the February 2008 Federal Trade Commission report on con- sumer fraud and identity theft, 23% of all complaints in 2007 were for identity theft. In that year, Arkansas had 1,601 complaints of identity theft out of 3,482 consumer complaints (”Consumer fraud and,” 2008).
Does this data provide enough evidence to show that Arkansas had a different percentage of identity theft than 23%? Test at the 5% level.
- According to the February 2008 Federal Trade Commission report on con- sumer fraud and identity theft, 23% of all complaints in 2007 were for identity theft. In that year, Alaska had 321 complaints of identity theft out of 1,432 consumer complaints (”Consumer fraud and,” 2008). Does this data provide enough evidence to show that Alaska had a different proportion of identity theft than 23%? Test at the 5% level.
- In 2001, the Gallup poll found that 81% of American adults believed that there was a conspiracy in the death of President Kennedy. In 2013, the Gallup poll asked 1,039 American adults if they believe there was a conspiracy in the assassination, and found that 634 believe there was a conspiracy (”Gallup news service,” 2013). Do the data show that the proportion of Americans who believe in this conspiracy has changed? Test at the 1% level.
- In 2008, there were 507 children in Arizona out of 32,601 who were diag- nosed with Autism Spectrum Disorder (ASD) (”Autism and developmen- tal,” 2008). Nationally 1 in 88 children are diagnosed with ASD (”CDC features -,” 2013). Is there sufficient data to show that the incident of ASD is different in Arizona than nationally? Test at the 1% level.
One-Sample Test for the Mean
It is time to go back to look at the test for the mean that was introduced in section 7.1 called the z-test. In the example, you knew what the population standard deviation, 𝜎, was. What if you don’t know 𝜎?
𝜎
If you don’t know , then you don’t know the sampling distribution of the mean. Can it be found another way? The answer is of course, yes. One way is to use a method called resampling. The following example explains how resampling is performed.
Example: Resampling
𝑘𝑔/𝑚
A random sample of 10 body mass index (BMI) were taken from the NHANES Data frame The mean BMI of Australians is 27.22. Is there evidence that Americans have a different BMI from people in Australia. Test at the 5% level.
Solution The standard deviation of BMI is not known for Australians. To answer this questions, first look at the sample from NHANES.
** Table 7.3.1: Sample of size 10 from NHANES data frame **
sample_NHANES_10<-sample_n(NHANES, size=10) sample_NHANES_10
## |
# A tibble: 10 x 76 |
|
|||||||
## |
ID SurveyYr Gender |
Age |
AgeDecade |
AgeMonths |
Race1 |
||||
## |
<int> <fct><fct> |
<int> |
<fct> |
<int> |
<fct> |
||||
## |
1 |
66193 |
2011_12 |
female |
25 |
“ |
20-29″ |
NA |
Black |
## |
2 |
64048 |
2011_12 |
female |
54 |
“ |
50-59″ |
NA |
White |
## |
3 |
55614 |
2009_10 |
female |
4 |
“ |
0-9″ |
56 |
Mexi~ |
## |
4 |
60144 |
2009_10 |
male |
57 |
“ |
50-59″ |
690 |
White |
## |
5 |
56347 |
2009_10 |
female |
2 |
“ |
0-9″ |
28 |
Other |
## |
6 |
60392 |
2009_10 |
female |
11 |
“ |
10-19″ |
134 |
Black |
## |
7 |
60160 |
2009_10 |
female |
63 |
“ |
60-69″ |
758 |
White |
## |
8 |
58215 |
2009_10 |
female |
54 |
“ |
50-59″ |
659 |
White |
## |
9 |
71016 |
2011_12 |
female |
5 |
“ |
0-9″ |
NA |
Mexi~ |
## |
10 |
63850 |
2011_12 |
female |
49 |
“ |
40-49″ |
NA |
White |
## |
# |
… with 69 more variables: Race3 <fct>, Education <fct>, |
|||||||
## |
# |
MaritalStatus <fct>, HHIncome <fct>, HHIncomeMid <int>, |
|||||||
## |
# |
Poverty <dbl>, HomeRooms <int>, HomeOwn <fct>, |
|||||||
## |
# |
Work <fct>, Weight <dbl>, Length <dbl>, HeadCirc <dbl>, |
|||||||
## |
# |
Height <dbl>, BMI <dbl>, BMICatUnder20yrs <fct>, |
|||||||
## |
# |
BMI_WHO <fct>, Pulse <int>, BPSysAve <int>, |
|||||||
## |
# |
BPDiaAve <int>, BPSys1 <int>, BPDia1 <int>, |
|||||||
## |
# |
BPSys2 <int>, BPDia2 <int>, BPSys3 <int>, BPDia3 <int>, |
|||||||
## |
# |
Testosterone <dbl>, DirectChol <dbl>, TotChol <dbl>, |
|||||||
## |
# |
UrineVol1 <int>, UrineFlow1 <dbl>, UrineVol2 <int>, |
|||||||
## |
# |
UrineFlow2 <dbl>, Diabetes <fct>, DiabetesAge <int>, |
|||||||
## |
# |
HealthGen <fct>, DaysPhysHlthBad <int>, |
|||||||
## |
# |
DaysMentHlthBad <int>, LittleInterest <fct>, |
|||||||
## |
# |
Depressed <fct>, nPregnancies <int>, nBabies <int>, |
|||||||
## |
# |
Age1stBaby <int>, SleepHrsNight <int>, |
|||||||
## |
# |
SleepTrouble <fct>, PhysActive <fct>, |
|||||||
## |
# |
PhysActiveDays <int>, TVHrsDay <fct>, CompHrsDay <fct>, |
|||||||
## |
# |
TVHrsDayChild <int>, CompHrsDayChild <int>, |
|||||||
## |
# |
Alcohol12PlusYr <fct>, AlcoholDay <int>, |
|||||||
## |
# |
AlcoholYear <int>, SmokeNow <fct>, Smoke100 <fct>, |
|||||||
## |
# |
Smoke100n <fct>, SmokeAge <int>, Marijuana <fct>, |
|||||||
## |
# |
AgeFirstMarij <int>, RegularMarij <fct>, |
|||||||
## |
# |
AgeRegMarij <int>, HardDrugs <fct>, SexEver <fct>, |
|||||||
## |
# |
SexAge <int>, SexNumPartnLife <int>, |
|||||||
## |
# |
SexNumPartYear <int>, SameSex <fct>, |
|||||||
## |
# |
SexOrientation <fct>, PregnantNow <fct> |
|||||||
The mean BMI from this sample is
df_stats(~BMI, data=sample_NHANES_10, mean)
##mean_BMI ## 1 23.58889
The sample mean for Americans is different from the mean BMI for Australians, but could it just be by chance. Suppose you take another sample of size 10, but you only have these 10 BMIs to work with. So how could you do this. One way is to assume that the sample you took is representative of the entire population, and so you create a population by copying this sample over and over again. So you could have over 1000 copies of this sample of 10 BMIs. Then take a sample of size 10 from this created population. When doing this, you could conceivably choose the same number several times that was in the original sample and not choose some of the numbers that were in the original sample. Instead of physically creating this new population, you could just take samples from your original sample but with replacement. This means that you randomly pick the first number, record it, and then put it back that value back before collecting the next number. This kind a sampling is called randomization sampling. A sample using randomization could be
Table #7.3.1a
resample(sample_NHANES_10)
## |
# A tibble: 10 x 77 |
|
|
|
|
||||
## |
ID SurveyYr Gender |
Age |
AgeDecade |
AgeMonths |
Race1 |
||||
## |
<int> <fct><fct> |
<int> |
<fct> |
<int> |
<fct> |
||||
## |
1 |
71016 |
2011_12 |
female |
5 |
“ |
0-9″ |
NA |
Mexi~ |
## |
2 |
64048 |
2011_12 |
female |
54 |
“ |
50-59″ |
NA |
White |
## |
3 |
55614 |
2009_10 |
female |
4 |
“ |
0-9″ |
56 |
Mexi~ |
## |
4 |
71016 |
2011_12 |
female |
5 |
“ |
0-9″ |
NA |
Mexi~ |
## |
5 |
55614 |
2009_10 |
female |
4 |
“ |
0-9″ |
56 |
Mexi~ |
## |
6 |
60144 |
2009_10 |
male |
57 |
“ |
50-59″ |
690 |
White |
## |
7 |
56347 |
2009_10 |
female |
2 |
“ |
0-9″ |
28 |
Other |
## |
8 |
60160 |
2009_10 |
female |
63 |
“ |
60-69″ |
758 |
White |
## |
9 |
64048 |
2011_12 |
female |
54 |
“ |
50-59″ |
NA |
White |
## |
10 |
55614 |
2009_10 |
female |
4 |
“ |
0-9″ |
56 |
Mexi~ |
## # … with 70 more variables: Race3 <fct>, Education <fct>, ## # MaritalStatus <fct>, HHIncome <fct>, HHIncomeMid <int>, ## # Poverty <dbl>, HomeRooms <int>, HomeOwn <fct>,
## # Work <fct>, Weight <dbl>, Length <dbl>, HeadCirc <dbl>, ## # Height <dbl>, BMI <dbl>, BMICatUnder20yrs <fct>,
## #BMI_WHO <fct>, Pulse <int>, BPSysAve <int>, ## #BPDiaAve <int>, BPSys1 <int>, BPDia1 <int>,
## #BPSys2 <int>, BPDia2 <int>, BPSys3 <int>, BPDia3 <int>, ## #Testosterone <dbl>, DirectChol <dbl>, TotChol <dbl>, ## #UrineVol1 <int>, UrineFlow1 <dbl>, UrineVol2 <int>,
## |
# |
UrineFlow2 <dbl>, Diabetes <fct>, DiabetesAge <int>, |
## |
# |
HealthGen <fct>, DaysPhysHlthBad <int>, |
## |
# |
DaysMentHlthBad <int>, LittleInterest <fct>, |
## |
# |
Depressed <fct>, nPregnancies <int>, nBabies <int>, |
## |
# |
Age1stBaby <int>, SleepHrsNight <int>, |
## |
# |
SleepTrouble <fct>, PhysActive <fct>, |
## |
# |
PhysActiveDays <int>, TVHrsDay <fct>, CompHrsDay <fct>, |
## |
# |
TVHrsDayChild <int>, CompHrsDayChild <int>, |
## |
# |
Alcohol12PlusYr <fct>, AlcoholDay <int>, |
## |
# |
AlcoholYear <int>, SmokeNow <fct>, Smoke100 <fct>, |
## |
# |
Smoke100n <fct>, SmokeAge <int>, Marijuana <fct>, |
## |
# |
AgeFirstMarij <int>, RegularMarij <fct>, |
## |
# |
AgeRegMarij <int>, HardDrugs <fct>, SexEver <fct>, |
## |
# |
SexAge <int>, SexNumPartnLife <int>, |
## |
# |
SexNumPartYear <int>, SameSex <fct>, |
## |
# |
SexOrientation <fct>, PregnantNow <fct>, orig.id <chr> |
Notice that some of the unit of observations are repeated. That is what happens when you resample. Now one resampling isn’t enough. So you want to resample many times so you can create a resampling distribution.
Resampling Distribution
60
count
40
20
0
−50510
mea
Figure 7.1: Resampling distribution
##mean_measd_mea ## 1 -2.177355 2.218221
Notice the sample mean from the resampling is very close to 0, so that means that the US BMI are not that different from the Australian BMI. There doesn’t seem to be enough evidence to show that the US BMI is different from the Australian BMI. One note, the sample size used here was 10 so you could see the sample, but really the sample size should be more than 100 for this method to be valid.
So this is one way to answer the question about if there is evidence to show a population mean is different from a value. This is actually the method that Ronald Fisher developed when he create all the foundation work that he did in statistics in the early 1900s. However, at the time, computers didn’t exist, so taking 100 reampling samples was not possible at that time. So other methods had to be developed that could be computed during that time. One method was developed by William (W.S) Gossett, a Chemist who worked for Guinness as their head brewer. Gossett developed a distribution called the Student’s T-distribution. His process was to use the sample standard deviation, s, as
an approximation of 𝜎. This means the test statistic is now 𝑡 = 𝑥√−𝑠 𝜇 . This
new test statistic is actually distributed as a Student’s t-distribution, d𝑛eveloped by W.S. Gossett. There are some assumptions that must be made for this formula to be a Student’s t-distribution. These are outlined in the following theorem. Note: the t-distribution is called the Student’s t-distribution because that is the name he published under because he couldn’t publish under his own name due to employer not wanting him to publish under his own name. His employer by the way was Guinness and they didn’t want competitors knowing they had a chemist/statistician working for them. It is not called the Student’s t-distribution because it is only used by students.
Theorem: If the following assumptions are met
- A random sample of size n is taken.
- The distribution of the random variable is normal.
𝑛 − 1
Then the distribution of is a Student’s t-distribution withdegrees of freedom.
Explanation of degrees of freedom: Recall the formula for sample standard
deviation is √. Notice the denominator is 𝑛 − 1. This is the same as the
∑ 𝑥−𝑥
𝑥̄
𝑛 − 1
degrees of freedo𝑛m−1. This is no accident. The reason the denominator and the degrees of freedom are both comes from how the standard deviation is calculated. First you take each data value and subtract . If you add up all of these new values, you will get 0. This must happen. Since it must happen, the first data values you have “freedom of choice”, but the nth data value, you have no freedom to choose. Hence, you havedegrees of freedom. Another way to think about it is that if you five people and five chairs, the first four people have a choice of where they are sitting, but the last person does not. They have no freedom of where to sit. Only 𝑛 − 1 people have freedom of choice.
0.0
0.1
The Student’s t-distribution is a bell-shape that is more spread out than the nor- mal distribution. There are many t-distributions, one for each different degree of freedom.
(Figure 7.2) is of the normal distribution and the Student’s t-distribution for df
= 1, df = 3, df=8, df=30.
Density
0.2
0.3
0.4
Comparison of t Distributions
Distributionsdf=1 df=3 df=8 df=30 normal
−4−2024
x value
Figure 7.2: Typical Student t-Distributions
As the degrees of freedom increases, the student’s t-distribution looks more like the normal distribution.
To find probabilities for the t-distribution, again technology can do this for you. There are many technologies out there that you can use.
Hypothesis Test for One Population Mean (t-Test)
- State the random variable and the parameter in words.
x = random variable
𝜇 = mean of random variable
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝜇 = 𝜇𝑜 , where 𝜇𝑜 is the known mean
𝐻𝑎 ∶ 𝜇 ≠ 𝜇𝑜, you can also use < or >, but ≠ is the more modern one to use. Also, state your 𝛼 level here.
- State and check the assumptions for a hypothesis test
- A random sample of size n is taken.
- The population of the random variable is normally distributed. The t-test is fairly robust to the condition if the sample size is large. This means that if this condition isn’t met, but your sample size is quite large, then the results of the t-test are valid.
- The population standard deviation, 𝜎, is unknown.
- Find the sample statistic, test statistic, and p-value On R Studio, the command is
t.test(~variable, data=data frame, mu=what Ho says)
- Conclusion
This is where you write reject or fail to reject 𝐻𝑜. The rule is: if the p-value
< 𝛼 , then reject 𝐻𝑜. If the p-value ≥ 𝛼, then fail to reject 𝐻𝑜
- Interpretation
This is where you interpret in real world terms the conclusion to the test. The conclusion for a hypothesis test is that you either have enough evidence to support 𝐻𝑎, or you do not have enough evidence to support 𝐻𝑎.
How to check the assumptions of t-test:
In order for the t-test to be valid, the assumptions of the test must be true. Whenever you run a t-test, you must make sure the assumptions are true. You need to check them. Here is how you do this:
- For the condition that the sample is a random sample, describe how you took the sample. Make sure your sampling technique is random.
- For the condition that population of the random variable is normal, re- member the process of assessing normality from chapter 6.
Note: if the assumptions behind this test are not valid, then the conclusions you make from the test are not valid. If you do not have a random sample, that is your fault. Make sure the sample you take is as random as you can make it following sampling techniques from chapter 1. If the population of the random variable is not normal, then take a larger sample. If you cannot afford to do that, or if it is not logistically possible, then you do different tests called non-parametric tests or you can try resampling. There is an entire course on non-parametric tests, and they will not be discussed in this book.
Example: Test of the Mean Using One Sample T- test
𝑘𝑔/𝑚
A random sample of 50 body mass index (BMI) were taken from the NHANES Data frame The mean BMI of Australians is 27.22. Is there evidence that Americans have a different BMI from people in Australia. Test at the 5% level.
Table #7.3.2: BMI of Americans
sample_NHANES_50<-sample_n(NHANES, size=50)head(sample_NHANES_50)
## # A tibble: 6 x 76
##167529 2011_12 female11″ 10-19″NA White##257517 2009_10 male2″ 0-9″29 White##357586 2009_10 male37″ 30-39″453 White##461234 2009_10 male35″ 30-39″429 White##558730 2009_10 male38″ 30-39″467 Other##655651 2009_10 female17″ 10-19″210 Other###… with 69 more variables: Race3 <fct>, Education <fct>,###MaritalStatus <fct>, HHIncome <fct>, HHIncomeMid <int>,###Poverty <dbl>, HomeRooms <int>, HomeOwn <fct>,###Work <fct>, Weight <dbl>, Length <dbl>, HeadCirc <dbl>,###Height <dbl>, BMI <dbl>, BMICatUnder20yrs <fct>,###BMI_WHO <fct>, Pulse <int>, BPSysAve <int>,###BPDiaAve <int>, BPSys1 <int>, BPDia1 <int>,###BPSys2 <int>, BPDia2 <int>, BPSys3 <int>, BPDia3 <int>,###Testosterone <dbl>, DirectChol <dbl>, TotChol <dbl>,###UrineVol1 <int>, UrineFlow1 <dbl>, UrineVol2 <int>,###UrineFlow2 <dbl>, Diabetes <fct>, DiabetesAge <int>,###HealthGen <fct>, DaysPhysHlthBad <int>,###DaysMentHlthBad <int>, LittleInterest <fct>,###Depressed <fct>, nPregnancies <int>, nBabies <int>,###Age1stBaby <int>, SleepHrsNight <int>,###SleepTrouble <fct>, PhysActive <fct>,###PhysActiveDays <int>, TVHrsDay <fct>, CompHrsDay <fct>,###TVHrsDayChild <int>, CompHrsDayChild <int>,###Alcohol12PlusYr <fct>, AlcoholDay <int>,###AlcoholYear <int>, SmokeNow <fct>, Smoke100 <fct>,###Smoke100n <fct>, SmokeAge <int>, Marijuana <fct>,###AgeFirstMarij <int>, RegularMarij <fct>,###AgeRegMarij <int>, HardDrugs <fct>, SexEver <fct>,###SexAge <int>, SexNumPartnLife <int>,###SexNumPartYear <int>, SameSex <fct>,
##ID SurveyYr GenderAge AgeDecade AgeMonths Race1 ##<int> <fct><fct> <int> <fct><int> <fct>
## #SexOrientation <fct>, PregnantNow <fct>
Solution:
- State the random variable and the parameter in words.
x = BMI of an American
𝜇 = mean BMI of Americans
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝜇 = 27.2
𝐻𝑎 ∶ 𝜇 ≠ 27.2
level of significance 𝛼 = 0.05
- State and check the assumptions for a hypothesis test
- A random sample of 50 BMI levels was taken. Check: A random sample was taken from the NHANES data frame using R Studio
- The population of BMI levels is normally distributed. Check:
gf_density(~BMI, data=sample_NHANES_50)
0.05
0.04
density
0.03
0.02
0.01
0.00
20304050
BMI
Figure 7.3: Density Plot of BMI from NHANES sample
gf_qq(~BMI, data=sample_NHANES_50)
50
sample
40
30
20
−2−1012
theoretical
Figure 7.4: Normal Quantile Plot of BMI from NHANES sample
The density plot looks somewhat skewed right and the normal quantile plot looks somewhat linear. However, there doesn’t seem to be strong evidence that the sample comes from a population that is normally distributed. However, since the sample is moderate to large, the t-test is robust to this assumption not being met. So the results of the test are probably valid.
- Find the sample statistic, test statistic, and p-value On R Studio, the command would be
t.test(~BMI, data= sample_NHANES_50, mu=27.2)
##
## One Sample t-test ##
## data: BMI
## t = 0.88982, df = 47, p-value = 0.3781
## alternative hypothesis: true mean is not equal to 27.2 ## 95 percent confidence interval:
## 25.70303 31.07156
## sample estimates: ## mean of x
## 28.38729
The test statistic is the t in the output, the sample statistic is the mean of x in the output, and the p-value is the p-value is the output.
- Conclusion
Since the p-value is not less than 5%, then fail to reject 𝐻𝑜.
- Interpretation
There is not enough evidence to support that Americans have a different BMI from Australians.
Note: this is the same conclusion that was found when using resampling. So the two method could give similar conclusions.
Example: Test of the Mean Using One Sample T- test
In 2011, the average life expectancy for a woman in Europe was 79.8 years. The data in table #7.3.3 are the life expectancies for all people in European countries (”WHO life expectancy,” 2013). Table #7.3.4 filtered the data frame for just males and just year 2000. The year 2000 was randomly chosen as the year to use. Do the data indicate that men’s life expectancy is different from women’s? Test at the 1% level.
Table #7.3.3: Life Expectancies for European Countries
Expectancy<-read.csv( “https://krkozak.github.io/MAT160/Life_expectancy_Europe.csv”)head(Expectancy)
##year WHO_region countrysex expect
## 1 1990 |
Europe Albania |
Male |
67 |
## 2 1990 |
Europe Albania |
Female |
71 |
## 3 1990 |
Europe Albania Both sexes |
69 |
|
## 4 2000 |
Europe Albania |
Male |
68 |
## 5 2000 |
Europe Albania |
Female |
73 |
## 6 2000 |
Europe Albania Both sexes |
71 |
|
Table #7.3.4: Life Expectancies of males in European Countries in 2000
Expectancy_male<- Expectancy%>%filter(sex==”Male”, year==”2000″)head(Expectancy_male)
##year WHO_regioncountry sex expect ## 1 2000EuropeAlbania Male68
## 2 2000 |
Europe |
Andorra Male |
76 |
## 3 2000 |
Europe |
Armenia Male |
68 |
## 4 2000 |
Europe |
Austria Male |
75 |
## 5 2000 |
Europe Azerbaijan Male |
64 |
|
## 6 2000 |
Europe |
Belarus Male |
63 |
Code book for data frame Expectancy
Description This data extract has been generated by the Global Health Obser- vatory of the World Health Organization. The data was extracted on 2013-09-19 13:10:20.0.
This data frame contains the following columns:
year: year for life expectancies
WHO_region: World Health Organizations designation for the location of the country
country: country where the epectancies are from
sex: sex of the group that expectancies are calculated for
expect: average life expectancies of the different groups of the different countries.
Sourcehttp://apps.who.int/gho/athena/data/download.xsl?format= xml&target=GHO/WHOSIS_000001&profile=excel&filter=COUNTRY:;SEX:;REGION:EUR
References World Health Organization (WHO).
Solution:
- State the random variable and the parameter in words.
x = life expectancy for a European man
𝜇 = mean life expectancy for European men
- State the null and alternative hypotheses and the level of significance
𝐻𝑜 ∶ 𝜇 = 79.8
𝐻𝑎 ∶ 𝜇 ≠ 79.8
𝛼 = 0.01
- State and check the assumptions for a hypothesis test
- A random sample of 53 life expectancies of European men in 2000 was taken. Check: The data is actually all of the life expectancies for every country that is considered part of Europe by the World Health Organiza- tion in the year 2000. Since the year 2000 was picked at random, then the sample is a random sample.
- The distribution of life expectancies of European men in 2000 is normally distributed. Check:
gf_density(~expect, data=Expectancy_male)
0.06
density
0.04
0.02
0.00
60657075
expect
Figure 7.5: Density Plot of Life Expectancies of Males in Europe in 2000
gf_qq(~expect, data=Expectancy_male)
This sample does not appear to come from a population that is normally dis- tributed. This sample is moderate to large, so it is good that the t-test is robust.
- Find the sample statistic, test statistic, and p-value On R Studio, the command is
t.test(~expect, data=Expectancy_male, mu=79.8)
##
## One Sample t-test ##
## data: expect
## t = -11.733, df = 52, p-value = 3.145e-16
## alternative hypothesis: true mean is not equal to 79.8 ## 95 percent confidence interval:
## 69.11930 72.23919
## sample estimates: ## mean of x
75
sample
70
65
60
−2−1012
theoretical
Figure 7.6: Normal Quantile Plot of Life Expectancies of Males in Europe in 2000
## 70.67925
Sample statistic is 70.68 years, test statistic is t = -11.733, and p-value = 3.14𝑋10−16.
- Conclusion
Since the p-value is less than 1%, then reject 𝐻𝑜.
- Interpretation
There is enough evidence to support that the mean life expectancy for European men is different than the mean life expectancy for European women of 79.8 years.
𝐻𝑎 ∶ 𝜇 > 𝜇𝑜
Note: if you want to conduct a hypothesis test with, then the R Studio command would be
t.test(~variable, data=Data Frame, mu=, alternative=”greater”)
𝐻𝑎 ∶ 𝜇 < 𝜇𝑜
If you want to conduct a hypothesis test with, then the R Studio command would be
t.test(~variable, data=Data Frame, mu=, alternative=”less”)
Homework
In each problem show all steps of the hypothesis test. If some of the assumptions are not met, note that the results of the test may not be correct and then continue the process of the hypothesis test.
- The Kyoto Protocol was signed in 1997, and required countries to start re- ducing their carbon emissions. The protocol became enforceable in Febru- ary 2005. In 2004, the mean CO2 emission was 4.87 metric tons per capita. Table 7.3.5 contains a random sample of CO2 emissions in 2010 (CO2 emissions (metric tons per capita), 2018). Is there enough evidence to show that the mean CO2 emission is different in 2010 than in 2004? Test at the 1% level.
Table #7.3.5: CO2 Emissions (in metric tons per capita) in 2010
Emission <- read.csv( “https://krkozak.github.io/MAT160/CO2_emission.csv”)head(Emission)
## |
country |
y1960 |
y1961 |
y1962 |
y1963 |
||||
## |
1 |
Aruba |
NA |
NA |
NA |
NA |
|||
## |
2 |
Afghanistan |
0.04605671 |
0.05358884 |
0.07372083 |
0.07416072 |
|||
## |
3 |
Angola |
0.10083534 |
0.08220380 |
0.21053148 |
0.20273730 |
|||
## |
4 |
Albania |
1.25819493 |
1.37418605 |
1.43995596 |
1.18168114 |
|||
## |
5 |
Andorra |
NA |
NA |
NA |
NA |
|||
## |
6 |
Arab World |
0.64573587 |
0.68746538 |
0.76357363 |
0.87823769 |
|||
## |
|
y1964 |
y1965 |
y1966 |
y1967 |
y1968 |
|||
## |
1 |
NA |
NA |
NA |
NA |
NA |
|||
## |
2 |
0.08617361 |
0.1012849 |
0.1073989 |
0.1234095 |
0.1151425 |
|||
## |
3 |
0.21356035 |
0.2058909 |
0.2689414 |
0.1721017 |
0.2897181 |
|||
## |
4 |
1.11174196 |
1.1660990 |
1.3330555 |
1.3637463 |
1.5195513 |
|||
## |
5 |
NA |
NA |
NA |
NA |
NA |
|||
## |
6 |
1.00305335 |
1.1705403 |
1.2781736 |
1.3374436 |
1.5522420 |
|||
## |
|
y1969 |
y1970 |
y1971 |
y1972 |
y1973 |
|||
## |
1 |
NA |
NA |
NA |
NA |
NA |
|||
## |
2 |
0.08650986 |
0.1496515 |
0.1652083 |
0.1299956 |
0.1353666 |
|||
## |
3 |
0.48023402 |
0.6082236 |
0.5645482 |
0.7212460 |
0.7512399 |
|||
## |
4 |
1.55896757 |
1.7532399 |
1.9894979 |
2.5159144 |
2.3038974 |
|||
## |
5 |
NA |
NA |
NA |
NA |
NA |
|||
## |
6 |
1.79866893 |
1.8103078 |
2.0037220 |
2.1208746 |
2.4095329 |
|||
## |
|
y1974y1975y1976y1977y1978 |
|||||||
## |
1 |
NANANANANA |
|||||||
## |
2 |
0.1545032 0.1676124 0.1535579 0.1815222 0.1618942 |
|||||||
## |
3 |
0.7207764 0.6285689 0.4513535 0.4692212 0.6947369 |
|||||||
## |
4 |
1.8490067 1.9106336 2.0135846 2.2758764 2.5306250 |
|||||||
## |
5 |
NANANANANA |
|||||||
## |
6 |
2.2858907 2.1967827 2.5843424 2.6487624 2.7623331 |
|||||||
## |
y1979 |
y1980 |
y1981 |
y1982 |
y1983 |
|||||
## |
1 |
NA |
NA |
NA |
NA |
NA |
||||
## |
2 |
0.1670664 |
0.1317829 |
0.1506147 |
0.1631039 |
0.2012243 |
||||
## |
3 |
0.6830629 |
0.6409664 |
0.6111351 |
0.5193546 |
0.5513486 |
||||
## |
4 |
2.8982085 |
1.9350583 |
2.6930239 |
2.6248568 |
2.6832399 |
||||
## |
5 |
NA |
NA |
NA |
NA |
NA |
||||
## |
6 |
2.8636143 |
3.0928915 |
2.9302350 |
2.7231544 |
2.8165670 |
||||
## |
|
y1984 |
y1985 |
y1986 |
y1987 |
y1988 |
||||
## |
1 |
NA |
NA |
2.8683194 |
7.2351980 |
10.0261792 |
||||
## |
2 |
0.2319613 |
0.2939569 |
0.2677719 |
0.2692296 |
0.2468233 |
||||
## |
3 |
0.5209829 |
0.4719028 |
0.4516189 |
0.5440851 |
0.4635083 |
||||
## |
4 |
2.6942914 |
2.6580154 |
2.6653562 |
2.4140608 |
2.3315985 |
||||
## |
5 |
NA |
NA |
NA |
NA |
NA |
||||
## |
6 |
2.9813539 |
3.0618504 |
3.2844996 |
3.1978064 |
3.2950428 |
||||
## |
y1989 |
y1990 |
y1991 |
y1992 |
y1993 |
|||||
## |
1 |
10.6347326 |
26.3745032 26.0461298 21.44255880 22.00078616 |
|||||||
## |
2 |
0.2338822 |
0.2106434 0.1833636 0.09619658 0.08508711 |
|||||||
## |
3 |
0.4372955 |
0.4317436 0.4155308 0.41052293 0.44172110 |
|||||||
## |
4 |
2.7832431 |
1.6781067 1.3122126 0.77472491 0.72379029 |
|||||||
## |
5 |
NA |
7.4673357 7.1824566 6.91205339 6.73605485 |
|||||||
## |
6 |
3.2566742 |
3.0169588 3.2366449 3.41548491 3.66944563 |
|||||||
## |
y1994 |
y1995 |
y1996 |
y1997 |
||||||
## |
1 |
21.03624511 |
20.77193616 |
20.31835337 |
20.42681771 |
|||||
## |
2 |
0.07580649 |
0.06863986 |
0.06243461 |
0.05664234 |
|||||
## |
3 |
0.28811907 |
0.78703255 |
0.72623346 |
0.49636125 |
|||||
## |
4 |
0.60020371 |
0.65453713 |
0.63662531 |
0.49036506 |
|||||
## |
5 |
6.49420042 |
6.66205168 |
7.06507147 |
7.23971272 |
|||||
## |
6 |
3.67435821 |
3.42400952 |
3.32830368 |
3.14553220 |
|||||
## |
|
y1998 |
y1999 |
y2000 |
y2001 |
|||||
## |
1 |
20.58766915 |
20.31156677 |
26.19487524 |
25.93402441 |
|||||
## |
2 |
0.05276322 |
0.04072254 |
0.03723478 |
0.03784614 |
|||||
## |
3 |
0.47581516 |
0.57708291 |
0.58196150 |
0.57431605 |
|||||
## |
4 |
0.56027144 |
0.96016441 |
0.97817468 |
1.05330418 |
|||||
## |
5 |
7.66078389 |
7.97545440 |
8.01928429 |
7.78695000 |
|||||
## |
6 |
3.34996719 |
3.32834106 |
3.70385708 |
3.60795615 |
|||||
## |
|
y2002 |
y2003 |
y2004 |
y2005 |
|||||
## |
1 |
25.67116178 |
26.42045209 |
26.51729342 |
27.20070778 |
|
||||
## |
2 |
0.04737732 |
0.05048134 |
0.03841004 |
0.05174397 |
|
||||
## |
3 |
0.72295888 |
0.50022540 |
1.00187812 |
0.98573636 |
|
||||
## |
4 |
1.22954071 |
1.41269720 |
1.37621273 |
1.41249821 |
|
||||
## |
5 |
7.59061514 |
7.31576071 |
7.35862494 |
7.29987194 |
|
||||
## |
6 |
3.60461275 |
3.79646741 |
4.06856241 |
4.18567731 |
|
||||
## |
|
y2006 |
y2007 |
y2008 |
y2009 |
y2010 |
||||
## |
1 |
26.94772597 |
27.89502282 |
26.2295527 25.9153221 24.6705289 |
||||||
## |
2 |
0.06242753 |
0.08389281 |
0.1517209 0.2383985 0.2899876 |
||||||
## |
3 |
1.10501903 |
1.20313400 |
1.1850005 1.2344251 1.2440915 |
||||||
## 4 1.30257637 1.32233486 1.4843111 1.4956002 1.5785736
## 5 6.74605213 6.51938706 6.4278100 6.1215799 6.1225947
## 6 4.28571918 4.11714755 4.4089483 4.5620151 4.6368134 ##y2011y2012y2013y2014 y2015 y2016
## 1 24.5075162 13.1577223 8.353561 8.4100642 |
NA |
NA |
|||
## 2 |
0.4064242 |
0.3451488 0.310341 0.2939464 |
NA |
NA |
|
## 3 |
1.2526808 |
1.3302186 1.253776 1.2903068 |
NA |
NA |
|
## 4 |
1.8037147 |
1.6929083 1.749211 1.9787633 |
NA |
NA |
|
## 5 |
5.8674102 |
5.9168840 5.901775 5.8329062 |
NA |
NA |
|
## 6 |
4.5594617 |
4.8377796 4.674925 4.8869875 |
NA |
NA |
|
## |
y2017 y2018 |
|
|
||
## 1 |
NA |
NA |
|
|
|
## 2 |
NA |
NA |
|
|
|
## 3 |
NA |
NA |
|
|
|
## 4 |
NA |
NA |
|
|
|
## 5 |
NA |
NA |
|
|
|
## 6 |
NA |
NA |
|
|
|
Code book for data frame Emission |
|
|
|||
Description Carbon dioxide emissions are those stemming from the burning of fossil fuels and the manufacture of cement. They include carbon dioxide produced during consumption of solid, liquid, and gas fuels and gas flaring.
This data frame contains the following columns:
country: country around the world
y1960-y2018: weighted averages of CO2 emission for the years 1960 through 2018 in metric tons per capita
Source CO2 emissions (metric tons per capita). (n.d.). Retrieved July 18, 2019, from https://data.worldbank.org/indicator/EN.ATM.CO2E.PC
References Carbon Dioxide Information Analysis Center, Environmental Sci- ences Division, Oak Ridge National Laboratory, Tennessee, United States.
- The amount of sugar in a Krispy Kream glazed donut is 10 g. Many people feel that cereal is a healthier alternative for children over glazed donuts. Table #7.3.6 contains the amount of sugar in a sample of cereal that is geared towards children (breakfast cereal, 2019). Is there enough evidence to show that the mean amount of sugar in children’s cereal is different than in a glazed donut? Test at the 5% level.
Table #7.3.6: Nutrition Amounts in Cereal
Sugar <- read.csv( “https://krkozak.github.io/MAT160/cereal.csv”)head(Sugar)
##namemanfage type
## 1704113010.05.063## 212035152.08.083## 370412609.07.053## 4504014014.08.003## 5110222001.0 14.083## 6110221801.5 10.5101
## 1100%_Bran Nabisco adult cold ## 2 100%_Natural_Bran Quaker_Oats adult cold ## 3All-Bran Kelloggs adult cold ## 4 All-Bran_with_Extra_Fiber Kelloggs adult cold ## 5 Almond_Delight Ralston_Purina adult cold ## 6 Apple_Cinnamon_Cheerios General_Mills child cold ## colories protein fat sodium fiber carb sugar shelf
## potassium vit weight serving
## |
1 |
280 |
25 |
1 |
0.33 |
## |
2 |
135 |
0 |
1 |
-1.00 |
## |
3 |
320 |
25 |
1 |
0.33 |
## |
4 |
330 |
25 |
1 |
0.50 |
## |
5 |
-1 |
25 |
1 |
0.75 |
## |
6 |
70 |
25 |
1 |
0.75 |
Code book for data frame Sugar
Description Nutritional information about cereals. This data frame contains the following columns:
name: the cereal brand manf: manufacturer
age: whether the cereal is geared towards children or adults type: whether the cereal is considered a hot or cold cereal calories: the number of calories in the cereal (number) protein: the amount of protein in a serving of the cereal (g) fat: the amount of fat a serving of the cereal (g)
sodium: the amount of sodium in a serving of the cereal (mg) fiber: the amount of fiber in a serving of the cereal (g)
carb: the amount of complex carbohydrates in a serving of the cereal (g) sugars: the amount of sugar in a serving of the cereal (g)
display shelf: what shelf the cereal is on counting from the floor potassium: the amount of potassium in a serving of the cereal (mg)
vit: the amount of vitamins and minerals in a serving of the cereal (0, 25, or 100)
weight: weight in ounces of one serving serving: cups per serving
Source (n.d.). Retrieved July 18, 2019, from https://www.idvbook.com/ teaching-aid/data-sets/the-breakfast-cereal-data-set/ The Best Kids’ Cereal. (n.d.). Retrieved July 18, 2019, from https://www.ranker.com/list/best-kids- cereal/ranker-food
References Interactive Data Visualization Foundations, Techniques, Applica- tions (Matthew Ward | Georges Grinstein | Daniel Keim)
A new data frame will need to be created of just cereal for children. To create that use the following command in R Studio
Table #7.3.7: Nutrition Amounts in Children’s Cereal
Sugar_children<- Sugar%>%filter(age==”child”) head(Sugar_children)
##name manf age type ## 1 Apple_Cinnamon_Cheerios General_Mills child cold ## 2Apple_Jacks Kelloggs child cold
## 3Bran_Chex Ralston_Purina child cold
## 4 Cap’n’Crunch Quaker_Oats child cold
## 5Cheerios General_Mills child cold ## 6 Cinnamon_Toast_Crunch General_Mills child cold ## colories protein fat sodium fiber carb sugar shelf
## 1 |
110 |
2 |
2 |
180 |
1.5 10.5 |
10 |
1 |
## 2 |
110 |
2 |
0 |
125 |
1.0 11.0 |
14 |
2 |
## 3 |
90 |
2 |
1 |
200 |
4.0 15.0 |
6 |
1 |
## 4 |
120 |
1 |
2 |
220 |
0.0 12.0 |
12 |
2 |
## 5 |
110 |
6 |
2 |
290 |
2.0 17.0 |
1 |
1 |
## 6 |
120 |
1 |
3 |
210 |
0.0 13.0 |
9 |
2 |
##1702510.75##2302511.00##31252510.67##4352510.75##51052511.25##6452510.75
## potassium vit weight serving
- The FDA regulates that fish that is consumed is allowed to contain 1.0 mg/kg of mercury. In Florida, bass fish were collected in 53 different lakes to measure the health of the lakes. The data frame of measurements from
Florida lakes is in table #7.3.8 (NISER 081107 ID Data, 2019). Do the data provide enough evidence to show that the fish in Florida lakes has different amounts of mercury than the allowable amount? Test at the 10% level.
Table #7.3.8: Health of Florida lake Fish
Mercury<- read.csv( “https://krkozak.github.io/MAT160/mercury.csv”)head(Mercury)
## |
ID |
lake |
alkalinity |
ph |
calcium |
chlorophyll |
||
## |
1 1 |
Alligator |
5.9 |
6.1 |
3.0 |
0.7 |
||
## |
2 2 |
Annie |
3.5 |
5.1 |
1.9 |
3.2 |
||
## |
3 3 |
Apopka |
116.0 |
9.1 |
44.1 |
128.3 |
||
## |
4 4 |
Blue_Cypress |
39.4 |
6.9 |
16.4 |
3.5 |
||
## |
5 5 |
Brick |
2.5 |
4.6 |
2.9 |
1.8 |
||
## |
6 6 |
Bryant |
19.6 |
7.3 |
4.5 |
44.1 |
||
##mercury no.samples min max X3_yr_standmercury age_data |
||||||||
## |
11.23 |
5 |
0.85 1.43 |
1.53 |
1 |
|||
## |
21.33 |
7 |
0.92 1.90 |
1.33 |
0 |
|||
## |
30.04 |
6 |
0.04 0.06 |
0.04 |
0 |
|||
## |
40.44 |
12 |
0.13 0.84 |
0.44 |
0 |
|||
## |
51.20 |
12 |
0.69 1.50 |
1.33 |
1 |
|||
## |
60.27 |
14 |
0.04 0.48 |
0.25 |
1 |
|||
Code book for data frame Mercury |
||||||||
Description Largemouth bass were studied in 53 different Florida lakes to examine the factors that influence the level of mercury contamination. Water samples were collected from the surface of the middle of each lake in August 1990 and then again in March 1991. The pH level, the amount of chlorophyll, calcium, and alkalinity were measured in each sample. The average of the August and March values were used in the analysis. Next, a sample of fish was taken from each lake with sample sizes ranging from 4 to 44 fish. The age of each fish and mercury concentration in the muscle tissue was measured. (Note: Since fish absorb mercury over time, older fish will tend to have higher concentrations). Thus, to make a fair comparison of the fish in different lakes, the investigators used a regression estimate of the expected mercury concentration in a three year old fish as the standardized value for each lake. Finally, in 10 of the 53 lakes, the age of the individual fish could not be determined and the average mercury concentration of the sampled fish was used instead of the standardized value. ( Reference: Lange, Royals, & Connor. (1993))
This data frame contains the following columns: ID: ID number
Lake: Name of lake
alkalinity: Alkalinity (mg/L as Calcium Carbonate) pH: pH
calcium: calcium (mg/l) chlorophyll: chlorophyll (mg/l)
mercury: Average mercury concentration (parts per million) in the muscle tissue of the fish sampled from that lake
no.samples: How many fish were sampled from the lake
min: Minimum mercury concentration among the sampled fish max: Maximum mercury concentration among the sampled fish
X3_yr_Standard_mercury: Regression estimate of the mercury concentration in a 3 year old fish from the lake (or = Avg Mercury when age data was not available)
age_data: Indicator of the availability of age data on fish sampled
Source Lange TL, Royals HE, Connor LL (1993) Influence of water chemistry on mercury concentration in largemouth bass from Florida lakes. Trans Am Fish Soc 122:74-84. Michael K. Saiki, Darell G. Slotton, Thomas W. May, Shaun M. Ayers, and Charles N. Alpers (2000) Summary of Total Mercury Concentrations in Fillets of Selected Sport Fishes Collected during 2000–2003 from Lake Natoma, Sacramento County, California (Raw data is included in appendix), U.S. Geological Survey Data Series 103, 1-21. NISER 081107 ID Data. (n.d.). Retrieved July 18, 2019, from http://wiki.stat.ucla.edu/socr/ index.php/NISER_081107_ID_Data
References NISER 081107 ID Data
- The data frame Pulse (Table 7.3.9) contains various variables about a person including their pulse rates before the subject exercised and after the subject ran in place for one minute. The mean pulse rate after running for 1 minute of females who do not drink is 97 beats per minute. Do the data show that the mean pulse rate of females who do drink alcohol is higher than the mean pulse rate of females who do not drink? Test at the 5% level.
Table #7.3.9: Pulse Rates Pulse Rates of people Before and After Exercise
Pulse<-read.csv( “https://krkozak.github.io/MAT160/pulse.csv”)head(Pulse)
##height weight age gender smokes alcohol exercise ran ## 117068 22maleyesyes moderate sat
## 218275 26maleyesyes moderate sat
## 3 |
180 |
85 |
19 |
male |
yes |
yes moderate ran |
|
## 4 |
182 |
85 |
20 |
male |
yes |
yes |
low sat |
## 5 |
167 |
70 |
22 |
male |
yes |
yes |
low sat |
## 6 |
178 |
86 |
21 |
male |
yes |
yes |
low sat |
## pulse_before pulse_after year
## 1 |
70 |
71 |
93 |
## 2 |
80 |
76 |
93 |
## 3 |
68 |
125 |
95 |
## 4 |
70 |
68 |
95 |
## 5 |
92 |
84 |
96 |
## 6 |
76 |
80 |
98 |
Code book for data frame Pulse, see homework problem 3.2.5 in section 3.2
Create a data frame that contains only females who drink alcohol. Then test the pulse after for woman who do drink alcohol to the known value for females who do not drink alcohol. To create a new data frame with just females who drink alcohol use the following command, where the new name is Females:
Table #7.3.10: Pulse Rates Pulse Rates of people Before and After Exercise
Females<- Pulse%>%filter(gender==”female”, alcohol==”yes”)head(Females)
##height weight age gender smokes alcohol exercise ran
## |
1 |
165 |
60 |
19 |
female |
yes |
yes |
low |
ran |
## |
2 |
163 |
47 |
23 |
female |
yes |
yes |
low |
ran |
## |
3 |
173 |
57 |
18 |
female |
no |
yes |
moderate |
sat |
## |
4 |
179 |
58 |
19 |
female |
no |
yes |
moderate |
ran |
## |
5 |
167 |
62 |
18 |
female |
no |
yes |
high |
ran |
## |
6 |
173 |
64 |
18 |
female |
no |
yes |
low |
sat |
## |
|
pulse_before |
pulse_after |
year |
|||||
## |
1 |
88 |
120 |
98 |
|||||
## |
2 |
71 |
125 |
98 |
|||||
## |
3 |
86 |
88 |
93 |
|||||
## |
4 |
82 |
150 |
93 |
|||||
## |
5 |
96 |
176 |
93 |
|||||
## |
6 |
90 |
88 |
93 |
|||||
- The economic dynamism is an index of productive growth in dollars. Eco- nomic data for many countries are in table #7.3.11 (SOCR Data 2008 World CountriesRankings, 2019). Countries that are considered high- income have a mean economic dynamism of 60.29.
Table #7.3.11: Economic Data for Countries
Economics <- read.csv( “https://krkozak.github.io/MAT160/Economics_country.csv”)head(Economics)
##Id incGroup keyname popGroupregion key2
## |
1 |
0 |
Low |
al |
Albania |
Small |
Southern_Europe popS |
## |
2 |
1 |
Middle |
dz |
Algeria |
Medium |
North_Africa popM |
## |
3 |
2 |
Middle |
ar |
Argentina |
Medium |
South_America popM |
## |
4 |
3 |
High |
au |
Australia |
Medium |
Australia popM |
## |
5 |
4 |
High |
at |
Austria |
Small |
Central_Europe popS |
## |
6 |
5 |
Low |
az |
Azerbaijan |
Small |
central_Asia popS |
## |
|
|
ED |
Edu |
HI |
QOL |
PE OA Relig |
## |
1 |
34.0862 81.0164 |
71.0244 67.9240 58.6742 5739 |
||||
## |
2 |
25.8057 74.8027 |
66.1951 60.9347 32.6054 8595 |
||||
## |
3 |
37.4511 69.8825 |
78.2683 68.1559 68.6647 4666 |
||||
## |
4 |
71.4888 91.4802 |
95.1707 90.5729 90.9629 465 |
||||
## |
5 |
53.9431 90.4578 |
90.3415 87.5630 91.2073 1820 |
||||
## |
6 |
53.6457 68.9880 |
58.9512 68.9572 40.0390 6950 |
||||
Code book for data frame Economics
Description These data represent commonly accepted measures for raking Countries on variety of factors which affect the country’s internal and exter- nal international perception of the country’s rank relative the to rest of the World.
This data frame contains the following columns:
id: Unique country identifier
incGroup: Income group: Low: GNI per capita < $3,946, Middle: $3,946 <
GNI per capita < $12,195, High: GNI per capita > $12,196 key: unique 2-letter country code
name: Country Name
popGroup: Population Group: Small: Population < 20 million, Medium: 20 million < Population < 50 million, Large: Population > 50 million
region: Relative geographic position of the Country
key2: Country Group Classification Label: world: All countries, g7: G7, g20: G20, latin: Latin America & Caribbean, eu: European Union, centasia: Europe & Central Asia, pacasia: East Asia & Pacific, asean: Asean, sasia: South Asia, mideast: Middle East & North Africa, africa: Sub-Saharan Africa, bric: Brazil, Russia, India and China (BRIC)
ED: Economic Dynamism: Index of Productive growth in dollars (GDP/capita at PPP, Avg of GDP/capita growth rate over last ten years, GDP/capita growth
rate over next ten years, Economic Dynamism: Manufacturing percent of GDP, Services percent of GDP percent (100=best, 0=worst).
Edu: Education/Literacy Rate (percent of population able to read and write at a specified age)
HI: Health Index: The average number of years a person lives in full health, taking into account years lived in less than full health
QOL: Quality of Life: Population percent living on < $2/day
PE: Political Environment: Freedom house rating of political participation (qualitative assessment of voter participation/turn-out for national elections, citizens engagement with politics)
OA: Overall country ranking taking all measures into account. Relig: Religiosity of the Country as a percent (%) of the population.
Source SOCR Data 2008 World CountriesRankings. (n.d.). Retrieved July 19, 2019, from http://wiki.stat.ucla.edu/socr/index.php/SOCR_Data_2008_ World_CountriesRankings#SOCR_Data_-_Ranking_of_the_top_100_ Countries_based_on_Political.2C_Economic.2C_Health.2C_and_Quality-
References SOCR Data 2008 World CountriesRankings, Amazon Web-Services World’s Best Countries.
Create a data frame that contains only middle income countries. Do the data show that the mean economic dynamism of middle-income countries is less than the mean for high-income countries? Test at the 5% level. To create a new data frame with just middle income countries use the following command, where the new name is Middle_economics:
##11MiddledzAlgeriaMediumNorth_AfricapopM##22MiddlearArgentinaMediumSouth_AmericapopM##37MiddlebyBelarusSmallcentral_AsiapopS##410MiddlebwBotswanaSmallAfricapopS##511MiddlebrBrazilLargeSouth_AmericapopL##612MiddlebgBulgariaSmallSouthern_EuropepopS##EDEduHIQOLPE OA Relig##125.8057 74.802766.1951 60.9347 32.6054 8595##237.4511 69.882578.2683 68.1559 68.6647 4666
Table #7.3.12: Economic Data for Middle income Countries
Middle_economics<- Economics%>%filter(incGroup==”Middle”) head(Middle_economics)
##Id incGroup keyname popGroupregion key2
## 3 51.9150 86.6155 66.1951 74.1467 34.0501 56 |
34 |
## 4 43.6952 73.4608 34.8049 50.0875 72.6833 80 |
80 |
## 5 47.8506 71.3735 71.0244 62.4238 67.4131 48 |
87 |
## 6 43.7178 82.2277 75.8537 73.1197 73.1686 38 |
50 |
- In 1999, the average percentage of women who received prenatal care per country is 80.1%. Table #7.3.13 contains the percentage of woman receiving prenatal care in a sample of countries over several years. (births per woman), 2019). Do the data show that the average percentage of women receiving prenatal care in 2009 (p2009) is different than in 1999? Test at the 5% level.
Table #7.3.13: Data of Prenatal Care versus Health Expenditure
Fert_prenatal<-read.csv( “https://krkozak.github.io/MAT160/fertility_prenatal.csv”)head(Fert_prenatal)
##1Lowermiddleincome7.4787.5247.5637.5927.6117.619##2Uppermiddleincome4.7864.6704.5214.3454.1503.950##3Uppermiddleincome6.5006.4806.4606.4406.4206.400##4Lowermiddleincome7.6917.7207.7507.7817.8117.841##5Lowincome6.8806.8776.8756.8726.8676.864##6Lowincome6.1146.1276.1386.1476.1546.160
##Country.Name Country.CodeRegion ## 1AngolaAGOSub-Saharan Africa ## 2ArmeniaARMEurope & Central Asia ## 3BelizeBLZ Latin America & Caribbean ## 4 Cote d’IvoireCIVSub-Saharan Africa ## 5EthiopiaETHSub-Saharan Africa ## 6GuineaGINSub-Saharan Africa ##IncomeGroup f1960 f1961 f1962 f1963 f1964 f1965
## |
f1966 |
f1967 |
f1968 |
f1969 |
f1970 |
f1971 |
f1972 |
f1973 |
f1974 |
|
## |
1 |
7.618 |
7.613 |
7.608 |
7.604 |
7.601 |
7.603 |
7.606 |
7.611 |
7.614 |
## |
2 |
3.758 |
3.582 |
3.429 |
3.302 |
3.199 |
3.114 |
3.035 |
2.956 |
2.875 |
## |
3 |
6.379 |
6.358 |
6.337 |
6.316 |
6.299 |
6.288 |
6.284 |
6.285 |
6.287 |
## |
4 |
7.868 |
7.893 |
7.912 |
7.927 |
7.936 |
7.941 |
7.942 |
7.939 |
7.929 |
## |
5 |
6.867 |
6.880 |
6.903 |
6.937 |
6.978 |
7.020 |
7.060 |
7.094 |
7.121 |
## |
6 |
6.168 |
6.177 |
6.189 |
6.205 |
6.225 |
6.249 |
6.277 |
6.306 |
6.337 |
## |
|
f1975 |
f1976 |
f1977 |
f1978 |
f1979 |
f1980 |
f1981 |
f1982 |
f1983 |
## |
1 |
7.615 |
7.609 |
7.594 |
7.571 |
7.540 |
7.504 |
7.469 |
7.438 |
7.413 |
## |
2 |
2.792 |
2.712 |
2.641 |
2.582 |
2.538 |
2.510 |
2.499 |
2.503 |
2.517 |
## |
3 |
6.278 |
6.250 |
6.195 |
6.109 |
5.992 |
5.849 |
5.684 |
5.510 |
5.336 |
## |
4 |
7.910 |
7.877 |
7.828 |
7.763 |
7.682 |
7.590 |
7.488 |
7.383 |
7.278 |
## |
5 |
7.143 |
7.167 |
7.195 |
7.230 |
7.271 |
7.316 |
7.360 |
7.397 |
7.424 |
## |
6 |
6.369 |
6.402 |
6.436 |
6.468 |
6.500 |
6.529 |
6.557 |
6.581 |
6.602 |
## |
|
f1984 |
f1985 |
f1986 |
f1987 |
f1988 |
f1989 |
f1990 |
f1991 |
f1992 |
## 1NANANANANANANANANA## 2NANANANANANANANANA## 3NANANA96NANANANANA## 4NANANANANANA83.2NANA## 5NANANANANANANANANA## 6NANANANA57.6NANANANA
## |
1 |
7.394 |
7.380 |
7.366 |
7.349 |
7.324 |
7.291 |
7.247 |
7.193 |
7.130 |
## |
2 |
2.538 |
2.559 |
2.578 |
2.591 |
2.592 |
2.578 |
2.544 |
2.484 |
2.400 |
## |
3 |
5.170 |
5.019 |
4.886 |
4.771 |
4.671 |
4.584 |
4.508 |
4.436 |
4.363 |
## |
4 |
7.176 |
7.078 |
6.984 |
6.892 |
6.801 |
6.710 |
6.622 |
6.536 |
6.454 |
## |
5 |
7.437 |
7.435 |
7.418 |
7.387 |
7.347 |
7.298 |
7.246 |
7.193 |
7.143 |
## |
6 |
6.619 |
6.631 |
6.637 |
6.637 |
6.631 |
6.618 |
6.598 |
6.570 |
6.535 |
## |
|
f1993 |
f1994 |
f1995 |
f1996 |
f1997 |
f1998 |
f1999 |
f2000 |
f2001 |
## |
1 |
7.063 |
6.992 |
6.922 |
6.854 |
6.791 |
6.734 |
6.683 |
6.639 |
6.602 |
## |
2 |
2.297 |
2.179 |
2.056 |
1.938 |
1.832 |
1.747 |
1.685 |
1.648 |
1.635 |
## |
3 |
4.286 |
4.201 |
4.109 |
4.010 |
3.908 |
3.805 |
3.703 |
3.600 |
3.496 |
## |
4 |
6.374 |
6.298 |
6.224 |
6.152 |
6.079 |
6.006 |
5.932 |
5.859 |
5.787 |
## |
5 |
7.094 |
7.046 |
6.995 |
6.935 |
6.861 |
6.769 |
6.659 |
6.529 |
6.380 |
## |
6 |
6.493 |
6.444 |
6.391 |
6.334 |
6.273 |
6.211 |
6.147 |
6.082 |
6.015 |
## |
|
f2002 |
f2003 |
f2004 |
f2005 |
f2006 |
f2007 |
f2008 |
f2009 |
f2010 |
## |
1 |
6.568 |
6.536 |
6.502 |
6.465 |
6.420 |
6.368 |
6.307 |
6.238 |
6.162 |
## |
2 |
1.637 |
1.648 |
1.665 |
1.681 |
1.694 |
1.702 |
1.706 |
1.703 |
1.693 |
## |
3 |
3.390 |
3.282 |
3.175 |
3.072 |
2.977 |
2.893 |
2.821 |
2.762 |
2.715 |
## |
4 |
5.717 |
5.651 |
5.589 |
5.531 |
5.476 |
5.423 |
5.372 |
5.321 |
5.269 |
## |
5 |
6.216 |
6.044 |
5.867 |
5.690 |
5.519 |
5.355 |
5.201 |
5.057 |
4.924 |
## |
6 |
5.947 |
5.877 |
5.804 |
5.729 |
5.653 |
5.575 |
5.496 |
5.417 |
5.336 |
## |
|
f2011 |
f2012 |
f2013 |
f2014 |
f2015 |
f2016 |
f2017 |
p1986 |
p1987 |
## |
1 |
6.082 |
6.000 |
5.920 |
5.841 |
5.766 |
5.694 |
5.623 |
NA |
NA |
## |
2 |
1.680 |
1.664 |
1.648 |
1.634 |
1.622 |
1.612 |
1.604 |
NA |
NA |
## |
3 |
2.676 |
2.642 |
2.610 |
2.578 |
2.544 |
2.510 |
2.475 |
NA |
NA |
## |
4 |
5.216 |
5.160 |
5.101 |
5.039 |
4.976 |
4.911 |
4.846 |
NA |
NA |
## |
5 |
4.798 |
4.677 |
4.556 |
4.437 |
4.317 |
4.198 |
4.081 |
NA |
NA |
## |
6 |
5.256 |
5.175 |
5.094 |
5.014 |
4.934 |
4.855 |
4.777 |
NA |
NA |
## |
|
p1988 |
p1989 |
p1990 |
p1991 |
p1992 |
p1993 |
p1994 |
p1995 |
p1996 |
## |
p1997 |
p1998 |
p1999 |
p2000 |
p2001 |
p2002 |
p2003 |
p2004 |
p2005 |
|
## |
1 |
NA |
NA |
NA |
NA |
65.6 |
NA |
NA |
NA |
NA |
## |
2 |
82 |
NA |
NA |
92.4 |
NA |
NA |
NA |
NA |
93.0 |
## |
3 |
NA |
98 |
95.9 |
100.0 |
NA |
98 |
NA |
NA |
94.0 |
## |
4 |
NA |
NA |
84.3 |
87.6 |
NA |
NA |
NA |
NA |
87.3 |
## |
5 |
NA |
NA |
NA |
26.7 |
NA |
NA |
NA |
NA |
27.6 |
## |
6 |
NA |
NA |
70.7 |
NA |
NA |
NA |
84.3 |
NA |
82.2 |
## |
|
p2006 |
p2007 |
p2008 |
p2009 |
p2010 |
p2011 |
p2012 |
p2013 |
p2014 |
## |
1 |
NA |
79.8 |
NA |
NA |
NA |
NA |
NA |
NA |
NA |
## |
2 |
NA |
NA |
NA |
NA |
99.1 |
NA |
NA |
NA |
NA |
## |
3 |
94.0 |
99.2 |
NA |
NA |
NA |
96.2 |
NA |
NA |
NA |
## |
4 |
84.8 |
NA |
NA |
NA |
NA |
NA |
90.6 |
NA |
NA |
## 5 NA NA NA NA NA 33.9 NA NA 41.2 ## 6 NA 88.4 NA NA NA NA 85.2 NA NA ## p2015 p2016 p2017 p2018 e2000 e2001 e2002
## 1 |
NA |
81.6 |
NA |
NA 2.334435 5.483824 4.072288 |
|||||
## 2 |
NA |
99.6 |
NA |
NA 6.505224 6.536262 5.690812 |
|||||
## 3 97.2 |
97.2 |
NA |
NA 3.942030 4.228792 3.864327 |
||||||
## 4 |
NA |
93.2 |
NA |
NA 5.672228 4.850694 4.476869 |
|||||
## 5 |
NA |
62.4 |
NA |
NA 4.365290 4.713670 4.705820 |
|||||
## 6 |
NA |
84.3 |
NA |
NA 3.697726 3.884610 4.384152 |
|||||
## |
e2003 |
e2004 |
e2005 |
e2006 |
e2007 |
e2008 |
|||
## |
1 |
4.454100 |
4.757211 |
3.734836 |
3.366183 |
3.211438 |
3.495036 |
||
## |
2 |
5.610725 |
8.227844 |
7.034880 |
5.588461 |
5.445144 |
4.346749 |
||
## |
3 |
4.260178 |
4.091610 |
4.216728 |
4.163924 |
4.568384 |
4.646109 |
||
## |
4 |
4.645306 |
5.213588 |
5.353556 |
5.808850 |
6.259154 |
6.121604 |
||
## |
5 |
4.885341 |
4.304562 |
4.100981 |
4.226696 |
4.801925 |
4.280639 |
||
## |
6 |
3.651081 |
3.365547 |
2.949490 |
2.960601 |
3.013074 |
2.762090 |
||
## |
|
e2009 |
e2010 |
e2011 |
e2012 |
e2013 |
e2014 |
||
## |
1 |
3.578677 |
2.736684 |
2.840603 |
2.692890 |
2.990929 |
2.798719 |
||
## |
2 |
4.689046 |
5.264181 |
3.777260 |
6.711859 |
8.269840 |
10.178299 |
||
## |
3 |
5.311070 |
5.764874 |
5.575126 |
5.322589 |
5.727331 |
5.652458 |
||
## |
4 |
6.223329 |
6.146566 |
5.978840 |
6.019660 |
5.074942 |
5.043462 |
||
## |
5 |
4.412473 |
5.466372 |
4.468978 |
4.539596 |
4.075065 |
4.033651 |
||
## |
6 |
2.936868 |
3.067742 |
3.789550 |
3.503983 |
3.461137 |
4.780977 |
||
##e2015e2016 ## 1 2.950431 2.877825
## 2 10.117628 9.927321
## 3 5.884248 6.121374
## 4 5.262711 4.403621
## 5 3.975932 3.974016
## 6 5.827122 5.478273
Code book for Dataframe Fert_prenatal See Problem 2.3.4 in Section 2.3 homework
- Maintaining your balance may get harder as you grow older. A study was conducted to see how steady the elderly is on their feet. They had the subjects stand on a force platform and have them react to a noise. The force platform then measured how much they swayed forward and backward, and the data is in table #7.3.14 (Maintaining Balance while Concentrating, 2019). Do the data show that the elderly sway more than the mean forward sway of younger people, which is 18.125 mm? Test at the 5% level. Follow the filtering methods in other homework problems to create a data frame for only Elderly.
Table #7.3.14: Sway (in mm) of Elderly Subjects
Sway <- read.csv( “https://krkozak.github.io/MAT160/sway.csv”)head(Sway)
##age fbsway sidesway
## 1 Elderly |
19 |
14 |
## 2 Elderly |
30 |
41 |
## 3 Elderly |
20 |
18 |
## 4 Elderly |
19 |
11 |
## 5 Elderly |
29 |
16 |
## 6 Elderly |
25 |
24 |
Code book for data frame Sway
Description How difficult is it to maintain your balance while concentrating? It is more difficult when you are older? Nine elderly (6 men and 3 women) and eight young men were subjects in an experiment. Each subject stood barefoot on a “force platform” and was asked to maintain a stable upright position and to react as quickly as possible to an unpredictable noise by pressing a hand held button. The noise came randomly and the subject concentrated on reacting as quickly as possible. The platform automatically measured how much each subject swayed in millimeters in both the forward/backward and the side-to-side directions.
This data frame contains the following columns:
Age: Elderly or Young
FBSway: Sway in forward/backward direction SideSwayy: Sway in side to side direction
Source Maintaining Balance while Concentrating. (n.d.). Retrieved July 19, 2019, from http://www.statsci.org/data/general/balaconc.html
References Teasdale, N., Bard, C., La Rue, J., and Fleury, M. (1993). On the cognitive penetrability of posture control. Experimental Aging Research 19, 1-13. The data was obtained from the DASL Data and Story Line online database.
Data Sources:
Australian Human Rights Commission, (1996). Indigenous deaths in custody 1989 – 1996. Retrieved from website: http://www.humanrights.gov.au/ publications/indigenous-deaths-custody
CDC features – new data on autism spectrum disorders. (2013, November 26). Retrieved from http://www.cdc.gov/features/countingautism/
Center for Disease Control and Prevention, Prevalence of Autism Spectrum Disorders – Autism and Developmental Disabilities Monitoring Network. (2008). Autism and developmental disabilities monitoring network-2012. Retrieved from website: http://www.cdc.gov/ncbddd/autism/documents/ADDM-2012- Community-Report.pdf
Federal Trade Commission, (2008). Consumer fraud and identity theft complaint data: January-December 2007. Retrieved from website: http://www.ftc.gov/ opa/2008/02/fraud.pdf
Sanchez, Y. W. (2016, October 20). Poll: Arizona voters still favor legal- izing marijuana.Retrieved from https://www.azcentral.com/story/news/ politics/elections/2016/10/20/poll-arizona-marijuana-legalization-proposition- 205/92417690/
http://apps.who.int/gho/athena/data/download.xsl?format=xml&target= GHO/WHOSIS_000001&profile=excel&filter=COUNTRY:;SEX:;REGION:EUR
CO2 emissions (metric tons per capita). (n.d.). Retrieved July 18, 2019, from https://data.worldbank.org/indicator/EN.ATM.CO2E.PC
(n.d.). Retrieved July 18, 2019, from https://www.idvbook.com/teaching- aid/data-sets/the-breakfast-cereal-data-set/ The Best Kids’ Cereal. (n.d.). Retrieved July 18, 2019, from https://www.ranker.com/list/best-kids- cereal/ranker-food
Lange TL, Royals HE, Connor LL (1993) Influence of water chemistry on mer- cury concentration in largemouth bass from Florida lakes. Trans Am Fish Soc 122:74-84. Michael K. Saiki, Darell G. Slotton, Thomas W. May, Shaun M. Ay- ers, and Charles N. Alpers (2000) Summary of Total Mercury Concentrations in Fillets of Selected Sport Fishes Collected during 2000–2003 from Lake Natoma, Sacramento County, California (Raw data is included in appendix), U.S. Geo- logical Survey Data Series 103, 1-21. NISER 081107 ID Data. (n.d.). Retrieved July 18, 2019, from http://wiki.stat.ucla.edu/socr/index.php/NISER_081107_ ID_Data
SOCR Data 2008 World CountriesRankings.(n.d.).Retrieved July 19, 2019,fromhttp://wiki.stat.ucla.edu/socr/index.php/SOCR_Data_2008_ World_CountriesRankings#SOCR_Data_-_Ranking_of_the_top_100_ Countries_based_on_Political.2C_Economic.2C_Health.2C_and_Quality-
Maintaining Balance while Concentrating. (n.d.). Retrieved July 19, 2019, from http://www.statsci.org/data/general/balaconc.html