Question: Please help with this R Assignment!! FIRST Here is the dataset, it is in a CSV format https://easyupload.io/l733rb Using code , find the object class

Please help with this R Assignment!!

FIRST

Here is the dataset, it is in a CSV format

https://easyupload.io/l733rb

  • Using code, find the object class of each column vector. Then find the object class of the entire data set. Describe if these make sense, or are there any that were unexpected? If they were unexpected, why?
  • Check out your variables that are text strings or characters. Do you want them to remain this way, or do you want to convert them into categorical variables, calledfactors? If they should be treated as categorical variables, please do so using thefactor()function.

Here's a HINT for the last item:

  • new_column <- factor(data$column)makes a completely new object outside of the dataset.
  • data$new_column <- factor(data$column)makes a new column that lives within the existing dataset.
  • data$column <- factor(data$column)overwrites the original column.

THEN

  • For 2 of your numeric/integer variables, get the mean, standard deviation, and range.
  • For your categorical variable, get very quick counts of each level (e.g., how many observations are there in group 1 vs.group 2).

LASTLY

  • Make a smaller datasets that only contain items from each level of your categorical variable. For example, let's say the factor "treatment_group" had 2 levels:treatmentandcontrol. Make a new data.frame that is something likedata_treatmentand another new data.frame that isdata_controls. Use INDEXING and LOGICAL OPERATORS.
  • One thing you might notice is that when you make your new mini data.frames, if you look at the factor variable, it still has the original number of levels from the bigger data.frame - even though the other levels are not in there. Overwrite that variable to be a factor again (same thing as in the Data Cleaning section above). After you should have only 1 level (ex: all treatment or all controls).
  • Now repeat the same summary statistics from above (for the numeric/integers only) but on each of your new mini data.frames. Do these numbers seem dramatically different or are they similar? What does that mean for your analysis?

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 Mathematics Questions!