Question

In: Statistics and Probability

Test of equal or given proportions: Use the “bacteria” data set to answer the question, “did...

Test of equal or given proportions: Use the “bacteria” data set to answer the question, “did the drug treatment have a significant effect of the presence of the bacteria compared with the placebo?”

Please use R to answer this question.

It should be use In R studio. dataset is also in the R. it's large to put here.

Just open R studio, view(bacteria).

Solutions

Expert Solution

we have to test for equal proportions, that is, both the placebo and the drug should have same effect, so, the number of 'yes's should be equal to the number of 'no's

So, our hypothesis is:

where p= proportion of children who have bacteria H. influenzae present.

This is a test for single proportions.

Code in R:

library(MASS)
data(bacteria)
prop=bacteria[[1]]
table(prop)
x=0
n=length(prop)
for(i in 1:n)
{ if(prop[i]=="y")
x=x+1 #to calculate number of cases with presence of bacteria
}

#single sample proportion test
prop.test(x=x,n=n,p=0.5,alternative='greater')

result:

interpretation:

p-value is very very small, so we can conclude on the basis of our data that the drug treatment have a significant effect of the presence of the bacteria compared with the placebo.


Related Solutions

Test of equal or given proportions: Use the “bacteria” data set to answer the question, “did...
Test of equal or given proportions: Use the “bacteria” data set to answer the question, “did the drug treatment have a significant effect of the presence of the bacteria compared with the placebo?” Please use R to answer this question. It should be use In R studio. dataset is also in the R
Use the following set of data to answer the question: is there a significant association between...
Use the following set of data to answer the question: is there a significant association between an immigrant’s length of time in the country and his/her level of acculturative stress, as measured by a well-being scale? The data are listed in the table below. Years Well-being In country score X Y 12 6 15 8 9 4 7 5 18 9 24 10 15 7 16 6 21 3 15 9 M = 15.20 M = 6.70 SSx = 235.60...
Use the given data set to answer parts​ (a) and​ (b). a. Find the regression equation...
Use the given data set to answer parts​ (a) and​ (b). a. Find the regression equation for the data points. b. Graph the regression equation and the data points. x 5 4 33 1 2 y 0 2 0 4 6 a. Find the regression equation for the data points.
Find the sample proportions and test statistic for equal proportions. (a-1) Dissatisfied workers in two companies:...
Find the sample proportions and test statistic for equal proportions. (a-1) Dissatisfied workers in two companies: x1 = 46, n1 = 100, x2 = 36, n2 = 100, α = .05, two-tailed test. (Round your answers to 4 decimal places. Use Excel to calculate the p-value.)   p1      p2      zcalc      p-value      zα/2 +/-    (a-2) Choose the appropriate hypotheses. a. H0:π1 – π2= 0 vs. H1:π1 – π2 ≠ 0. Reject H0 if zcalc < –1.96 or zcalc...
Find the sample proportions and test statistic for equal proportions. (a-1) Dissatisfied workers in two companies:...
Find the sample proportions and test statistic for equal proportions. (a-1) Dissatisfied workers in two companies: x1 = 44, n1 = 100, x2 = 34, n2 = 100, α = .05, two-tailed test. (Round your answers to 4 decimal places. Use Excel to calculate the p-value.) p1 = p2 = zcalc = p-value = zα/2 = (a-2) Choose the appropriate hypotheses. H0:π1 – π2= 0 vs. H1:π1 – π2 ≠ 0. Reject H0 if zcalc < –1.96 or zcalc >...
test the hypothesis (α = 0.05) that the population proportions of red and brown are equal...
test the hypothesis (α = 0.05) that the population proportions of red and brown are equal (pred = pbrown). You are testing if their proportions are equal to one another. NOTE: These are NOT independent samples, but we will use this approach anyway to practice the method. This also means that n1 and n2 will both be the total number of candies in all the bags. The “x” values for red and brown are the counts of each we found...
Use MS Excel to answer this. From the data given below test a hypothesis for variances...
Use MS Excel to answer this. From the data given below test a hypothesis for variances being equal. Use α = 0.05. Section A Section B 15 16 26 52 52 55 53 57.5 54 58 56.5 60 61 61 61.5 70 63 70 66 71 66 72 66.5 73 69 74.5 71 75 77 75.5 77 76 78 77 79 81 81 85 86 85.5 87 86 90 88 90 88.5 91 91 91 93 94 95 96 98...
Question 1: A small data set is given below. You will run a t-test using Excel....
Question 1: A small data set is given below. You will run a t-test using Excel. In order to receive full credit, you must turn in Excel output and your final answers. Round off final answers to three decimal places, if appropriate. A medical researcher wants to determine whether a drug changes the body’s temperature. Seventest subjects are randomly selected, and the body temperature (in degrees Fahrenheit) of each is measured. The subjects are then given the drug and after...
Given the data set below, use it to answer the following questions: 10, 20, 30, 40,...
Given the data set below, use it to answer the following questions: 10, 20, 30, 40, 50 a. Find the standard deviation b. Add 5 to each data set value and find the standard deviation. c. Subtract 5 from each value and find the standard deviation. d. Multiply by 5 on each value and find the standard deviation. e. Divide by 5 on each value and find the standard deviation. f. Generalize the results in parts a-e.
Using the following data, test the question that an equal number of Democrats, Republicans, and the...
Using the following data, test the question that an equal number of Democrats, Republicans, and the Independents voted during the most recent election. Test this hypothesis at the .05 level of significance. Political Affiliation Republican Democrat Independent 800 700 900
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT