Question: Help explain how to do step by step scripts in R Studio: Our task is to create a script that will analyze the 'presidents' dataset

Help explain how to do step by step scripts in R Studio:
Our task is to create a script that will analyze the 'presidents' dataset which is an R built-in dataset. This is what the script will do:
1. Import the presidents data into a data frame called PresAp. The data is stored as a time series. Use the as.numeric() function to store it into a data frame.
2. Clean the data! (Remove the NA from the data) Hint: You can use the drop_na() function which is part of the tidyr package.
3. Calculate the measures of Central Tendency (mean, median, and mode) and store them into the following variables: PresMean, PresMedian, PresMode.
4. Calculate the measures of variations (Standard Deviation and Range) and store them into the following variables: PresSd and PreRange
5. Calculate the Z-scores for all the data points and add it to PresAP as a column called Zscores.
6. Using the filter function (which is part of the dplyr package), display the outliers (if any).
7. Using the filter function, display all values that have a \( z \) score of \(>|2|\)
Help explain how to do step by step scripts in R

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!