Advertisement
Guest User

stats holder stuff db

a guest
Apr 26th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. library(UsingR)
  2. #P(Z > Za) = a
  3. #P(Z > Z0.01) = 0.01
  4. #Z0.01 = ?
  5.  
  6. qnorm(1-0.01,0,1)
  7. #This is 1 mius the area to the right of the Z score
  8. #Notation: P(Z > 2.33) = 0.01
  9.  
  10. #Sampling distrobution
  11. #-A firm believes the internal rate of return for all its proposed investments
  12. #--has a mean of 50% and standard deviation of 3%
  13. #--A random sample of 35 investments is obtained
  14.  
  15. #Random Variable: The internal rate of return on invesments
  16. #Quantitative Contenuous
  17. #Population: All Proposed Investments
  18. #Sample: 35 Investments
  19. #Parameter: Mean + Data Population
  20. #--In words: The True mean internal rate of return for all investments
  21. #Startistic: (Symbol is X with a bar over it) Mean + Data Sample
  22. #--In Words: The Mean internal rate of return for 35 investments
  23.  
  24. #What is the Sampling Distrobution of (X Bar)?
  25. #Requirement: Sample Size is greater than 30, or if the text says it's normal
  26. #The Sampling Distrobution is (X bar) is about normal with
  27. #--Mu(Xbar) = 50%, and a Stabdard Deviation of (Standard Deviation / Square Root of Sample Size)
  28.  
  29. #(Import data sets as "From Excel")
  30.  
  31. #Test the hypothesis that the weights of UCA Students who do want to try the japonese cheese cakes
  32. #--Is greater than those who don't.
  33. #Parameters: Mu1 = Weight of students who want to try, Mu2 = Weight of students who don't want to try
  34. #Both these Mus are Parameters
  35.  
  36. attach(upsurvey1)
  37. #Seperate the erights by j_cheese
  38. names(upsurvey1)
  39. weight_yes <- weight[j_cheese == "Yes"]
  40. weight_no <- weight[(j_cheese == "No") | (j_cheese == "Maybe")]
  41.  
  42. #H0: Mu1 == Mu2
  43. #H1: Mu1 > Mu2
  44.  
  45. t.test(weight_yes, weight_no, var.equal = F, alternative = "greater")
  46. #P Value = 0.485
  47. #We fail to reject the Null Hypothesis (H0) because P Value is greater than the Alpha Value (0.485 > 0.01)
  48. #Weight yes has over 30 Samples so it meets requirements
  49. #Weight no has less than 30 so it needs a Shapiro test
  50. shapiro.test(weight_no)
  51. #Shapiro P = 0.04756
  52. #0.04756 < 0.05, so this does not meet requirements
  53.  
  54. #Center = mean [mean()]
  55. #Spread = Standard Deviation [sd()]
  56. #Shape = Boxplot [boxplot(weight, horizontal = T)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement