Posts

Showing posts from September, 2021

Module #3 Assignment

 Module 3 Assignment: Code from R Workspace #Declaring vector data sets entitled set_1 and set_2 set_1 <- c(10,2,3,2,4,2,5) set_2 <- c(20,12,13,12,14,12,15) #Central Tendency Computations using set_1 (mean, median, standard deviation and quantile) mean(set_1, trim = 0, na.rm = FALSE) median(set_1, na.rm = FALSE) sd(set_1, na.rm = FALSE) quantile(set_1, trim = 0, na.rm = FALSE) #Coefficient of Variation represented as a percentage for set_1 sd(set_1, na.rm = TRUE)/mean(set_1, na.rm = TRUE)*100 #Summary gives a generic breakdown of where certain values fall with respect to eachother on their respevtive interval summary (set_1) #Central Tendecy Computations using set_2 (mean, median, standard deviation and quantile) mean(set_2, trim = 0, na.rm = FALSE) median(set_2, na.rm = FALSE) sd(set_2, na.rm = FALSE) quantile(set_2, trim = 0, na.rm = FALSE) #Coeffiecient of Variation represented as a percentage for set_2 sd(set_2, na.rm = TRUE)/mean(set_2, na.rm = TRUE)*100 R-Console Results &g

Assignment 2 LIS4273

  Assignment 2: myMean This assignment featured a relatively simple R function that does a few things in succession: Declares a data set, Declares a function that manipulates or points out a certain trend in the data (in this case we are taking a statistical mean), and finally, declares a result variable to the function and prints the resultant mean. My code is as follows #Declare data set and define as assignment2 assignment2 <- c(6,18,14,22,27,17,22,20,22) #Write function for the data set, which involves taking the mean of the data set myMean <- function(assignment2) {return(sum(assignment2)/length(assignment2))} # Declare result variable to be presented as the mean of assignment2 (line 6) Resultant Mean of the assignment2 data set (line 8) using the print function on the newly defined 'result.mean' variable result.myMean <- mean(assignment2) #Result print(result.myMean) [1] 18.66666666667 My resultant mean for this data set was 18.66666666667