Question

In: Statistics and Probability

Please solve all of the question using R and do clarify the answers. Using the (SATGPA)...

Please solve all of the question using R and do clarify the answers.

Using the (SATGPA) data set in (Stat2Data) package. Test by using ?= .01.

1) Create the following three variables and then print out all the six variables.

A) Create new variable "SAT", which is the sum of (MathSAT) and (VerbalSAT).

B) 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.

C)Create third new variable "GPALevel" and assign the value of "GPALevel" as 1 when

GPA<=2.8, 2 when 2.8<GPA<=3.3, 3 when 3.3<GPA<=3.5, and 4 when GPA>3.5

D) Print out all the data in the ascending order of their GPALevel and the descending order of

their SAT when( GPALevel )is the same.

2) Use the Chi-Square test to conclude if the SATLevel and GPALevel are independent.

3) Compute the mean and variance of "GPA" for each level of( "GPALevel"), and compute the

correlation matrices for the four variables: MathSAT, VerbalSAT, GPA and SAT.

4) Do the data provide sufficient evidence to indicate that the mean of (MathSAT) is significantly greater

than the mean of (VerbalSAT.)

5) Test if the proportion of ( MathSAT) greater than (VerbalSAT) is 0.5.

Solutions

Expert Solution

I am providing you the code with conclusions. you can run and check it.

########## Question 1
data("SATGPA")
y=SATGPA;gpa=y$GPA
sat=y$MathSAT+y$VerbalSAT
satlevel=rep()
satlevel[which(sat<=1100)]=1;satlevel[which(sat<=1200&sat>1100)]=2
satlevel[which(sat>1300)]=4;satlevel[which(sat<=1300&sat>1200)]=3

gpalevel=rep()
gpalevel[which(gpa<=2.8)]=1;gpalevel[which(gpa>2.8&gpa<=3.3)]=2
gpalevel[which(gpa>3.5)]=4;gpalevel[which(gpa>3.3&gpa<=3.5)]=3

newdata=cbind(y,sat,satlevel,gpalevel)
newdata <- newdata[order(gpalevel,-sat),]
#############Question 2
library(MASS)       # load the MASS package
tbl = table(satlevel, gpalevel)
tbl
chisq.test(tbl)

# As p value is large so we can not reject the null hypthesis, i.e SATLevel and GPALevel are independent

####Question 3
mean(gpa[which(gpalevel==1)]);var(gpa[which(gpalevel==1)])
mean(gpa[which(gpalevel==2)]);var(gpa[which(gpalevel==2)])
mean(gpa[which(gpalevel==3)]);var(gpa[which(gpalevel==3)])
mean(gpa[which(gpalevel==4)]);var(gpa[which(gpalevel==4)])

newdata<-cbind(y,sat)
cor(newdata)
####### Question 4
t.test(y$MathSAT,y$VerbalSAT,alternative = "greater")
############## Here p value is less than 0.05 so at alpha=.05 we reject the null hypothesis
#i.e the data provide sufficient evidence to indicate that the mean of (MathSAT) is significantly greater
#than the mean of (VerbalSAT.)


Related Solutions

SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE (SHOW ANSWERS IN R MARKDOWN FORWAT WITH CODE AND ANSWERS) PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2...
***Please only reply with answers using R. Please leave for other experts if not able to...
***Please only reply with answers using R. Please leave for other experts if not able to help with R programming. I need help trying to figure out how to set up a simulation to the below question using R. The annual demand for Prizdol, a prescription drug manufactured and marketed by the NuFeel Company, is normally distributed with mean 50,000 and standard deviation 12,000. We assume that demand during each of the next 10 years is an independent random draw...
Please solve all parts of the following question. Please show all work and all steps. 1a.)...
Please solve all parts of the following question. Please show all work and all steps. 1a.) Solve x' = x + 3y + 2t y' = x - y + t^2 1b.) Solve x' + ty = -1 y' + x' = 2 1c.) Solve x' + y = 3t y' - tx' = 0
please solve all.
please solve all.
please be DETAILED with the answers! this is a ruminant nutrition question do not answer if...
please be DETAILED with the answers! this is a ruminant nutrition question do not answer if unsure A complete dairy diet contains 55% alfalfa, 40% corn and 5% cotton seed meal. List all of the chemical compounds in the diet (e.g. starch). For each compound you have listed, describe the fermentation process in the rumen. For each compound identify what % is fermented in the rumen and what % is digested in the intestine
The Book of R (Question 20.2) Please answer using R code. Continue using the survey data...
The Book of R (Question 20.2) Please answer using R code. Continue using the survey data frame from the package MASS for the next few exercises. The survey data set has a variable named Exer , a factor with k = 3 levels describing the amount of physical exercise time each student gets: none, some, or frequent. Obtain a count of the number of students in each category and produce side-by-side boxplots of student height split by exercise. Assuming independence...
For expert using R I try to solve this question((USING DATA FAITHFUL)) but each time I...
For expert using R I try to solve this question((USING DATA FAITHFUL)) but each time I solve it, I have error , I try it many times. So,everything you write will be helpful.. Modify the EM-algorithm functions to work for a general K component Gaussian mixtures. Please use this function to fit a K= 1;2;3;4 modelto the old faithful data available in R (You need to initialize the EM-algorithm First ).    Which modelseems to t the data better? (Hint:...
Please solve all answers on Excel and show step by step how you get the WACC...
Please solve all answers on Excel and show step by step how you get the WACC answer.   Tornado Motors is a major producer of sport and utility trucks. It is a family owned company, started by Jane Biscayne in 1935, at the height of the Great Depression. Today the firm produces 3 lines of trucks. These include a standard, no-frills short bed pickup truck (Model A), a mid-size version (Model B ) and a larger, heavy-duty work truck (Model C)....
The title of the course is OS. All answers should be based on that. Please do...
The title of the course is OS. All answers should be based on that. Please do not copy and paste answers on chegg or on google for me. All answers should be based on your understanding on the course. Please try as much to answer the questions based on what is asked and not setting your own questions and answering them. Let it be if you want copy and paste answers. ********************************************************************************************************************************************************************************************************************** (1) Operating systems protect the computer hardware and...
Can You please Answer the question using R studio and R cloud Telomeres are complexes of...
Can You please Answer the question using R studio and R cloud Telomeres are complexes of DNA and protein that cap chromosomal ends. They consist of the same short DNA sequence TTAGGG repeated over and over again. They tend to shorted with cell divisions and with advancing cellular age, which will lead to chromosome instability or apoptosis (programmed cell death). Eukaryotic cells have the ability to reverse telomere shortening by expressing telomerase, an enzyme that extends the telomeres of chromosomes....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT