Question

ANSWER ALL OF THE QUESTIONS WITH R CODE (SHOW ALL THE STEPS FOR THE R CODE!) THANK YOU!!

R problems For questions 1 and 2, load in and attach the Getting to Know You Survey for Spring 2018 using the following code: NoU <-read. csr(file = http://users, stat . umn .edu/~kinne 174/Getting2NoUS 18 .csv, header = TRUE) attach(NoU) Assume that this survey is a random sample drawn from the population of interest which is all University of Minnesota students. 1. We are interested in determining the minimum sample size needed for a new survey to find a confidence interval for the true proportion p of students who are in favor of legalizing marijuana. We want a margin of error less than 3% and will use a 94% confidence interval. (a) We will need an estimate of p so we will use the sample proportion from our current survey. Calculate p using the following code table(legalizing.marijuana) margin.table(table(legalizing.marijuana))

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi. There is no data attached with this question. So I will give you the code explaining what to do, but I can't run it and show you the results. If you have any doubts, please ask in the coments below.

I am answering Q2 as that is only complete question.

2.

a)

hist (height) ## This will create histogram of the data.

qqnorm(height) # This will create a normal Q-Q plot of the data

qqline(height) ## adds a theoritical line in the plot.

Histogram of height 50 60 70 80 90 height

Normal Q-Q Plot 3 210 2 Theoretical Quantiles

0 100 200300 400 Index

Shape: The data is approximately bell shaped curve. So normal assumption should be resonable.

Spread: The data is between 50 to 88 and with std deviation 4.44245.

Centre: The data is centered around 65~ 70. The mean of the data is 67.7.

Normality: The data can be considered as approximately normal as the q-q plot is a straight line and alomst coincide with the theoritical line.

EXPLANATION: If the data has histogram of above shape, then you can use t-test. Why?

Because the t-test confidence interval assumes the normality of the graph. So, if one is to use t-test, the data must be approximately normal. As t = \frac{\sqrt{n}(\bar{x}-\mu)}{s} follows t(n-1) when X is normal.

So before applying the t-test, we test for normality by plotting the points or lokking at q-q plot.

b. Here we are trying to calculate the CI with t.test function. This function assumes normality of the data.

t.test (x = height, conf.level = .97)

here x= vector which contains height data and Conf level is desired level of confidence needed. You'll get the CI as result.

You can aslo try t.test (x = height, conf.level = .97)$conf.int to directly get CI

One Sample t-test

data: height
t = 332.84, df = 476, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
97 percent confidence interval:
67.25886 68.14433
sample estimates:
mean of x
67.70159

The 97% CI is 67.25886 68.14433

c.

for mean and std. dev, we have inbuild function

Use

mean(height) = 67.7

sd(height) = 4.44

d.

As for confidence interval, we need the two sided probability. So we break 3% into 1.5% and 1.5%

So for critical t value, we use

qt(0.985, df)

0.985 because of that 1.5% only in one sided tail

df = no. of observation -1 = n-1

e.

We have the formula for 97% CI for \mu

97% CI of \mu is   \bar{X} \mp t_{\alpha/2 , n-1}s.d. /\sqrt{n}

The interpretaion is: By observing the data and under normality assumption, the probability that mean lies outside the given 97% interval is less than or equal to 3%.

So we have about 97% probability of getting our mean in that interval.

Thanks

Please give me thumbs up if you like, comment if you have any doubts.

Add a comment
Know the answer?
Add Answer to:
ANSWER ALL OF THE QUESTIONS WITH R CODE (SHOW ALL THE STEPS FOR THE R CODE!)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • R code all steps (copy paste it) - for all answers . R problem 1: Cernsus...

    R code all steps (copy paste it) - for all answers . R problem 1: Cernsus At School is a project that engages students in grades 4 - 12. The data from the project contains many variables. In this problem we will examine the following variables: -Languages.spoken: the number of languages a student can hold an everyday conversation Armspan.cm: the physical measurement of the length from one end of a student's arms (measured at the fingertips) to the other when...

  • Please solve the questions using R language and attach the script with it!!! zoom it if...

    Please solve the questions using R language and attach the script with it!!! zoom it if the picture is not clear. Please solve the questions using R language and attach the script with it!!! Please solve the questions using R language and attach the script with it!!! What is the probability that a penny I have will land "heads" when tossed? To analyze this question I randomly toss the coin, n=3901 times. On x = 2500 of these tosses, the...

  • R CODE PROGRAM 1. Suppose we want to simulate an experiment that can take outcomes 1;...

    R CODE PROGRAM 1. Suppose we want to simulate an experiment that can take outcomes 1; : : : ; n with probabilies p1; : : : ; pn. To be specic, suppose the R-vector p=c(.1,.2,.3,.35, .02, .03) gives the desired probabilities. Write R code that produces a number from 1 to 6 with the given probabilities, without using if statements. I recommend using the R command cumsum to do this, though there many possible approaches. 2. Suppose we are...

  • Question 21 3 pts Large Sample Proportion Problem. Surveys were conducted in multiple countries and respondents...

    Question 21 3 pts Large Sample Proportion Problem. Surveys were conducted in multiple countries and respondents were asked if they felt political news was reported fairly. The data for the United States is that out of 1,000 sampled, 470 indicated yes, they felt political news was reported fairly. Suppose we want to construct a 99% confidence interval. What is the Bound of Error (BOE)? 0.0309 2.576 0.0407 0.4293 to 5107 Question 22 3 pts Large Sample Proportion Problem. Surveys were...

  • Question 21 3 pts Large Sample Proportion Problem. A survey was conducted on high school marijuana...

    Question 21 3 pts Large Sample Proportion Problem. A survey was conducted on high school marijuana use. Of the 2266 high school students surveyed, 970 admitted to smoking marijuana at least once. A study done 10 years earlier estimated that 45% of the students had tried marijuana. We want to conduct a hypothesis test to see if the true proportion of high school students who tried marijuana is now less than 45%. Use alpha = .01. What is the critical...

  • ***Please solve the problem below using R, and provide the R code you used in order...

    ***Please solve the problem below using R, and provide the R code you used in order to do so. Please show all work.*** A survey of 200 people found that 128 people stated that they were trying to avoid trans fats in their diets. a) Find the 95% confidence interval of the true proportion of people who are trying to avoid trans fats in their diets. b) A researcher claims that at least 60% of people are trying to avoid...

  • ***Please solve the problem below using R, and provide the R code you used in order...

    ***Please solve the problem below using R, and provide the R code you used in order to do so. Please show all work.*** A survey of 200 people found that 128 people stated that they were trying to avoid trans fats in their diets. a) Find the 95% confidence interval of the true proportion of people who are trying to avoid trans fats in their diets. b) A researcher claims that at least 60% of people are trying to avoid...

  • please show the steps and formulas needed in order to correctly answer each question. thank you...

    please show the steps and formulas needed in order to correctly answer each question. thank you in advance. 6) In a survey of 327 registered voters, 167 of them wished to see Mayor Waffleskate lose her next election. Find a point estimate for the proportion of registered voters who wish to see Mayor Waffleskate defeated 7) A survey of 800 women shoppers found that 17 % of them shop confidence interval for the true proportion of women shoppers who shop...

  • н Select one answer 10 points Parking survey: For a class assignment, a group of statistics...

    н Select one answer 10 points Parking survey: For a class assignment, a group of statistics students set up a table near the student parking lot. They asked students who passed by to complete a quick survey about whether they support the building of a multi- level parking structure that would add 425 new spaces at the college. They used the information from the survey to calculate the 95% confidence interval: (0,53, 0.72). To which population does the confidence interval...

  • (d) Mark all of the following that correctly describe the confidence LEVEL, or the "long-run" interpretation...

    (d) Mark all of the following that correctly describe the confidence LEVEL, or the "long-run" interpretation of "95% confidence" Participants in a survey were asked whether they favored or opposed the death penalty for people convicted of murder. Software shows the results below. Here, X refers to the number of the respondents who were IN FAVOR of the death penalty. Sample p 1764 2565 95.0% CI (0.670, 0.706) (a) Show how to obtain the value that should be reported under...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT