Question

In: Statistics and Probability

Use the following code to access data from the Getting To Know You Survey that was...

Use the following code to access data from the Getting To Know You Survey that was just conducted. The dataset can also be found online at the link: http://users.stat.umn.edu/~wuxxx725/data/ Getting2NoUS2020.csv. NoU<- read.csv("http://users.stat.umn.edu/~wuxxx725/data/Getting2NoUS2020.csv", header = TRUE) attach(NoU) 1. Are US students more likely to favor legalizing marijuana? The following two variables will be used. • international.student International student? Two categories ”U.S.” or ”International” • legalizing.marijuana Favor legalizing marijuana? Two categories ”Yes” or ”No”(although three categories are available, we only care about yes or no group)

(a) Run the command below to construct a contingency table. table(international.student,legalizing.marijuana)

(b) Let p1 and p2 denote the proportion favoring marijuana legalization among international students and US students, respectively. Use prop.test() command to construct a 95% confidence interval for comparing p1 and p2. Can you conclude which of p1 and p2 is larger? Explain.

(c) Test your conclusion in (b) at the .05 level using prop.test() command. You only need to show your code and output.

(d) Interpret the reported p-value.

I specifically need help on how to properly run the prop.test

Solutions

Expert Solution

NoU<- read.csv("http://users.stat.umn.edu/~wuxxx725/data/Getting2NoUS2020.csv", header = TRUE)
attach(NoU)
table(international.student,legalizing.marijuana)

prop.test(x =c(7,175),n = c(8+7,175+46))

this is command for

prop.test(x, n, p = NULL, alternative = "two.sided", correct = TRUE)

yes column 7 for International and 175 for US

i have ignored sample for why they are not sure

hence

7+8 = 15

for US 175 +46

95 percent confidence interval: -0.6188632 -0.0315139

p2 is larger as all values are negative in CI

note that p-value in output = 0.009773 is for two-tailed test

for left-tailed test

it will be half of 0.009773

since p-value < alpha

we reject the null hypothesis


Related Solutions

Does anyone know how to import data from Microsoft Excel code to use in R programming...
Does anyone know how to import data from Microsoft Excel code to use in R programming ?
Data from field investigation: The survey conducted by getting information from various sources including the statistical...
Data from field investigation: The survey conducted by getting information from various sources including the statistical records in the respective ministries, municipality and mukhtars has resulted in a population figure of 85,600 persons at present residing in the town under design. Review of the previous statistics has shown that the average yearly rate at which the population has been steadily increasing is 1.75%. Further investigations from neighboring communities that lead similar sociological conditions and considering the water demanded by the...
I'm getting an error message with this code and I don't know how to fix it...
I'm getting an error message with this code and I don't know how to fix it The ones highlighted give me error message both having to deal Scanner input string being converted to an int. I tried changing the input variable to inputText because the user will input a number and not a character or any words. So what can I do to deal with this import java.util.Scanner; public class Project4 { /** * @param args the command line arguments...
please use the following statement from Mike Herncki -The Ultimate Secret of Getting Absolutely Everything You...
please use the following statement from Mike Herncki -The Ultimate Secret of Getting Absolutely Everything You Want for this week's DQ.  " You must recognize that whatever your world looks like right now, you alone have caused it to look that way. " Please list reference
In R, Use library(MASS) to access the data sets for this test. Use the Pima.tr data...
In R, Use library(MASS) to access the data sets for this test. Use the Pima.tr data set to answer questions 1-5. What is the average age for women in this data set? What is the maximum number of pregnancies for women in this data set ? What is the median age for women who have diabetes? What is the median age for women who do not have diabetes? What is the third quartile of the skin variable?
PLEASE USE PYTHON CODE Compute the zero of the function y(x) from the following data: x...
PLEASE USE PYTHON CODE Compute the zero of the function y(x) from the following data: x = 0.2, 0.4, 0.6, 0.8, 1.0 y = 1.150, 0.855, 0.377, -0.266, -1.049 Use inverse interpolation with the natural cubic spline
You are opening a pizzeria, and you have access to a secret survey of MSU students...
You are opening a pizzeria, and you have access to a secret survey of MSU students that reveals local pizza demand to be described by this function: Qp = 150 - 30Pp + 10Pj - 5GI, where Qp is the number of slices of pizza demanded, PP is price of pizza, PJ is price of peanut butter and jelly sandwiches, and GI is the population of gluten intolerant individuals. For the 5 short-answer questions below, give answers in order with...
As you know, the risk of two assets is calculated by getting the square root of...
As you know, the risk of two assets is calculated by getting the square root of the equation: sP2= w12s12+  w22s22+ 2w1w2r12s1s2 Explain what would happen if one of the two assets was a risk-free asset. In other words, what would be the risk of the combination of the two assets? You have to explain that in accordance with the above equation.
You are to use your code from part A of this assignment and add to it....
You are to use your code from part A of this assignment and add to it. In this part of the project, you are to do the following: 1. In the count_voters function you are to add code to: • Count the number of votes for Trump • Count the number of votes for Biden • Count the number of females • Count the number of males • Count the number of Democrats • Count the number of Republicans •...
The following data is from a survey that was conducted in both 1996 and 2001. Did...
The following data is from a survey that was conducted in both 1996 and 2001. Did the rates of smoking differ from 1996 to 2001? *Smokers are defined as those who smoke every day. State the Null and Alternative hypothesis. If possible, USING EXCEL, run a CHI square test. 1996 2001 Grade Smokers* Non smokers Smokers* Non smokers 8th       1,101     13,566          815     13,852 10th       2,107     12,560       1,833     12,834 12th       3,187    ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT