Question

In: Math

Please use R to do it. Using the SATGPA data set in Stat2Data package. Test by...

Please use R to do it.

Using the SATGPA data set in Stat2Data package. Test by using α= .05

Question: Test if the proportion of MathSAT greater than VerbalSAT is 0.60

> library(Stat2Data)
> data("SATGPA")
> data(SATGPA)
> SATGPA

Solutions

Expert Solution

Let p bet the true proportion of MathSAT greater than VerbalSAT. We want to test if the proportion of MathSAT greater than VerbalSAT is 0.60, that is we want to test if p=0.60

The hypotheses are

The hypothesized value of proportion is

The standard error of proportions is

let be the sample proportion of MathSAT greater than VerbalSAT

The test statistics is

This is a 2 tailed test. The p-value is

We will reject the null hypothesis if the p-value is less than alpha=0.05.

R code to do all the above (all statements starting with # are comments and can be removed)

#install the package for the first time
install.packages('Stat2Data')

#load the library
library(Stat2Data)
#load the data
data(SATGPA)
#check some records
head(SATGPA)

#calculate the sample size
n<-nrow(SATGPA)
#calculate the sample proportion
phat<-sum(SATGPA$MathSAT>SATGPA$VerbalSAT)/n
#set the hypothesized value of p
p0<-0.60
#calculate the standard error of proportion
se<-sqrt(p0*(1-p0)/n)
#calculate the test statistics
z<-(phat-p0)/se
#calculate the p-value for 2 sided test
pval<-2*(1-pnorm(z))
#print the statsitics
sprintf('The sample proportion is %.4f',phat)
sprintf('The standard error is %.4f',se)
sprintf('The test statistics is %.2f',z)
sprintf('The p-value is %.4f',pval)
if (pval<0.05) {
sprintf('Reject the null hypothesis')
} else {
sprintf('Fail to reject the null hypothesis')
}

#get this

We fail to reject the null hypothesis.

We conclude that there is no sufficient evidence to reject the claim that the proportion of MathSAT greater than VerbalSAT is 0.60

Or

We conclude that the proportion of MathSAT greater than VerbalSAT is 0.60


Related Solutions

Using the SATGPA data set in Stat2Data package. Test by using α= .05. 1) Create the...
Using the SATGPA data set in Stat2Data package. Test by using α= .05. 1) Create the following three variables and then print out all the six variables. Create a new variable “SAT”, which is the sum of MathSAT and VerbalSAT. Create second new variable “SATLevel”, and assign the value of “SATLevel” as 1 when SAT<=1100, 2 when 1100<SAT<=1200, 3 when 1200<SAT<=1300, and 4 when SAT>1300. Create third new variable “GPALevel” and assign the value of “GPALevel” as 1 when GPA<=2.8,...
Use R statictical software. Load the ISLR package to get the Auto data set. Fit below...
Use R statictical software. Load the ISLR package to get the Auto data set. Fit below non-linear models to the Auto data set. We will treat horsepower as the predictor and mpg as the response. • Fit the cubic spline with 3 knots (25th percentile, 50th percentile, and 75th percentile of horsepower) • Fit the natural spline with 3 knots (25th percentile, 50th percentile, and 75th percentile of horsepower) • Fit the smoothing spline by choosing optimal lambda with cross-validation....
using the mtcars data set data(mtcars) USE data in mtcars library in R 5.Use k means...
using the mtcars data set data(mtcars) USE data in mtcars library in R 5.Use k means cluster analysis. 6. Get cluster means. 7. Visualize the clustering result.
Use R studio to do this problem. This problem uses the wblake data set in the...
Use R studio to do this problem. This problem uses the wblake data set in the alr4 package. This data set includes samples of small mouth bass collected in West Bearskin Lake, Minnesota, in 1991. Interest is in predicting length with age. Finish this problem without using Im() (a) Compute the regression of length on age, and report the estimates, their standard errors, the value of the coefficient of determination, and the estimate of variance. Write a sentence or two...
Using the package “wooldridge’, and the data ‘hprice1’ (in R-Software) to estimate the model price =...
Using the package “wooldridge’, and the data ‘hprice1’ (in R-Software) to estimate the model price = β0 + β1sqrft + β2bdrms + u , where is the house price measured in thousands of dollars. 1. Write out the results in equation form. 2.  What is the estimated increase in price for a house with one more bedroom, holding square footage constant? 3. What is the estimated increase in price for a house with an additional bedroom that is 140 square feet...
Ex. 6.2. In cloud seeding data clouds (R package HSAUR3”), refitting this data set after removing...
Ex. 6.2. In cloud seeding data clouds (R package HSAUR3”), refitting this data set after removing any observations which may give cause for concern (outliers). Please use R-studio
Use RStudio. The carsafety data set in the UsingR package has records of the number of...
Use RStudio. The carsafety data set in the UsingR package has records of the number of passenger deaths in the “Other.deaths” column and the type of vehicle in the type column. Determine which type of vehicle is the deadliest for passengers by looking at difference in variance between groups.
Using the following set of data, please find the mode, median, standard deviation and t-test for...
Using the following set of data, please find the mode, median, standard deviation and t-test for females and males. Females: A.) Mean B.) Median C.) Standard Deviation D.) T-test Males: A.) Mean B.) Median C.) Standard Deviation D.) T-test FEMALES: Female 1 Time (in Seconds): 225.62  Simple reaction: 0.262 Female 2 Time (in Seconds): 400.04 Simple reaction: 0.234 Female 3 Time (in Seconds): 469.16 Simple reaction: 0.199 Female 4 Time (in Seconds): 386.39 Simple reaction: 0.259 Female 5 Time (in Seconds):...
I am using the phbirths data in the faraway package in R. I want to: 1)...
I am using the phbirths data in the faraway package in R. I want to: 1) create a plot of the birth weight vs the gestational age and I want to colour code the points based on the mothers smoking status to determine whether or not smoking affects the babies. 2) fit a simple model (one regression line) along with both the main effects (parallel lines) and interaction (non parallel lines) ANCOVA model to the data and find out which...
I need this in R code please: Use the dataset ’juul’ in package ’ISwR’ to answer...
I need this in R code please: Use the dataset ’juul’ in package ’ISwR’ to answer the question. (1) Conduct one-way ANOVA test to test if the mean of igf1 of each level of tanner are the same? (2) What is the mean of igf1 in each level of tanner? (3) If there is any difference, which ones appear to be different? (Use pairwise t test for each pair of level with bonferroni method)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT