The commands below load these R packages and will appear at the top of all your R Markdown homework files.
Problem 1: Explain the difference between a population and a sample.
Answer: A population is a collection of all people of subjects that you are wishing to make an inference about. While a sample is a subset of the events, subjects, or objects that you use to make an inference about the whole population.
Problem 2: Classify the following variables as categorical (qualitative) or quantitative.
Problem 3: Identify the population and sample of the following research objective:
A college notices that an increasing number of full-time students are working while attending the school. The administration randomly selects 128 students and asks how many hours per week each of them works.
Answer: The population if full time college students that attend the college in question.
Problem 4: Determine whether the following study depicts an observational study or an experiment.
Rats with cancer are divided into two groups. One group receives 5 miligrams(mg) of a medication that is thought to fight cancer, and the other receives 10 mg. After 2 years, the spread of of the cancer is measured.
Answer: experiment
Problem 5: Are young couples who marry or cohabitate more likely to gain weight than those who stay single? Researchers followed 8000 men and women for 7 years. At the estart of the study, none of the participants were married or living with a romantic partner. The researchers found that women who married or cohabitated during the study gained 9 pounds more than single women, and married or cohabitating men gained, on average, 6 pounds more than single men.
Answer:1. it is an observational study because the researcher has no control over the variables in this test. 2. The response variable is the amount of weight gained by each individual 3.Some lurking variables would be peoples time commitments, people who dont spend time working out have more time to seak a relationship. 4.No, because there are so many other factors that could be affecting this, while it may strongly correlate it may not be because of the cohabitation, or marriage itself but because of other factors.
Problem 6: Define simple random sampling. Answer: simple random sampling is a type of unbiased sampling that allows every individual in the population to have an equal chance of being selected for the study as the next individual.
Problem 7: Using the AllCountries data set, list the variable names and the first few cases using the head() command in R. Try also using the command names() to get just the variable names.
Answer: ountry Code LandArea Population Energy Rural Military HealthCountry" “Code” “LandArea” “Population”
[5] “Energy” “Rural” “Military” “Health”
[9] “HIV” “Internet” “Developed” “BirthRate”
[13] “ElderlyPop” “LifeExpectancy” “CO2” “GDP”
[17] “Cell” “Electricity” “kwhPerCap”
head(AllCountries)
## Country Code LandArea Population Energy Rural Military Health HIV
## 1 Afghanistan AFG 652230 29.021 NA 76.0 4.4 3.7 NA
## 2 Albania ALB 27400 3.143 2088 53.3 NA 8.2 NA
## 3 Algeria ALG 2381740 34.373 37069 34.8 13.0 10.6 0.1
## 4 American Samoa ASA 200 0.066 NA 7.7 NA NA NA
## 5 Andorra AND 470 0.084 NA 11.1 NA 21.3 NA
## 6 Angola ANG 1246700 18.021 10972 43.3 NA 6.8 2.0
## Internet Developed BirthRate ElderlyPop LifeExpectancy CO2 GDP
## 1 1.7 NA 46.5 2.2 43.9 0.02503483 501.4709
## 2 23.9 1 14.6 9.3 76.6 1.31285501 3678.2317
## 3 10.2 1 20.8 4.6 72.4 3.23296040 4494.8867
## 4 NA NA NA NA NA NA NA
## 5 70.5 NA 10.4 NA NA 6.52783463 NA
## 6 3.1 1 42.9 2.5 47.0 1.35108829 4422.5428
## Cell Electricity kwhPerCap
## 1 37.80711 NA <NA>
## 2 141.92896 1747.0980 Under 2500
## 3 92.42126 970.9825 Under 2500
## 4 NA NA <NA>
## 5 77.17642 NA <NA>
## 6 46.68924 202.1545 Under 2500
Problem 8: Run Knit HTML to convert your R markdown to a web page document.
Problem 9: In the resulting window, proofread your markdown document. When you’re satisfied that everything is correct click on “Open in Browser”, select “print”" from your browser, and then “Save as PDF”. Upload the resulting PDF to the assignment area in Moodle.