Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(UsingR)
- #P(Z > Za) = a
- #P(Z > Z0.01) = 0.01
- #Z0.01 = ?
- qnorm(1-0.01,0,1)
- #This is 1 mius the area to the right of the Z score
- #Notation: P(Z > 2.33) = 0.01
- #Sampling distrobution
- #-A firm believes the internal rate of return for all its proposed investments
- #--has a mean of 50% and standard deviation of 3%
- #--A random sample of 35 investments is obtained
- #Random Variable: The internal rate of return on invesments
- #Quantitative Contenuous
- #Population: All Proposed Investments
- #Sample: 35 Investments
- #Parameter: Mean + Data Population
- #--In words: The True mean internal rate of return for all investments
- #Startistic: (Symbol is X with a bar over it) Mean + Data Sample
- #--In Words: The Mean internal rate of return for 35 investments
- #What is the Sampling Distrobution of (X Bar)?
- #Requirement: Sample Size is greater than 30, or if the text says it's normal
- #The Sampling Distrobution is (X bar) is about normal with
- #--Mu(Xbar) = 50%, and a Stabdard Deviation of (Standard Deviation / Square Root of Sample Size)
- #(Import data sets as "From Excel")
- #Test the hypothesis that the weights of UCA Students who do want to try the japonese cheese cakes
- #--Is greater than those who don't.
- #Parameters: Mu1 = Weight of students who want to try, Mu2 = Weight of students who don't want to try
- #Both these Mus are Parameters
- attach(upsurvey1)
- #Seperate the erights by j_cheese
- names(upsurvey1)
- weight_yes <- weight[j_cheese == "Yes"]
- weight_no <- weight[(j_cheese == "No") | (j_cheese == "Maybe")]
- #H0: Mu1 == Mu2
- #H1: Mu1 > Mu2
- t.test(weight_yes, weight_no, var.equal = F, alternative = "greater")
- #P Value = 0.485
- #We fail to reject the Null Hypothesis (H0) because P Value is greater than the Alpha Value (0.485 > 0.01)
- #Weight yes has over 30 Samples so it meets requirements
- #Weight no has less than 30 so it needs a Shapiro test
- shapiro.test(weight_no)
- #Shapiro P = 0.04756
- #0.04756 < 0.05, so this does not meet requirements
- #Center = mean [mean()]
- #Spread = Standard Deviation [sd()]
- #Shape = Boxplot [boxplot(weight, horizontal = T)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement