r_project


立即下载 求赞有赞必回
2024-04-20
vector Takes function follo wing finds deviation standard returns
93.8 KB

STA 032 SQ 2020 | R Poject
Instructions
• Complete the problems below in R Markdown.
• You may work in pairs (groups of 2) or individually.
• All code should be organized and placed in the appendix, unless needed in the problem.
• You will be graded on accuracy, format, and presentation. (This is a report.)
• The report is due on Canvas, Friday, June 5th 11:59pm (PT).
Problems
1. Create functions which perform the following tasks:
(a) Takes in a vector, and subtracts the mean and divides by the standard deviation (I.e., for every
xi finds (xi − x̄)/s). Then returns the standard deviation of the result. Test the function on the
following vector: X = 1:100.
(b) Takes in a vector and finds the values which are (x̄− 2s, x̄ + 2s) where s is the sample standard
deviation, and returns both value X = 1:100
(c) Takes in a vector, and calculates the mean after removing any observations that are more than 3
standard deviations from the mean. Test the function on the following vecto


vector/Takes/function/follo/wing/finds/deviation/x̄/standard/returns/ vector/Takes/function/follo/wing/finds/deviation/x̄/standard/returns/
-1 条回复
登录 后才能参与评论
-->