Highlights
For this assignment, you will submit a report showing your script and the output. There is a really cool way to make this report called R Markdown. I would love for you to create your report in R using R Markdown but if it is too much, you can make it in Word. Be sure to include your R code and appropriate output.
1. Use the variable grass from the GSS2016 dataset. Don t forget the codebookPreview the document!
a. What does this variable represent? Should marijuana be made legal? b. What is the variable s level of measurement? What would you do to figure this out in R?
c. Run a table of the variable to get the frequencies for each of the attributes.
d. Create a new variable grassrecode from the existing variable. Recode this new variable to remove all of the Don t Know, No Answer, and Not Applicable responses.
e. Run an updated table of the variable.
2. Open an excel spreadsheet. Use the table below to create a .csv file and save as "sample1.csv". Name Age Gender Height Daniel 25 M 72 Cammi 24 F 61 Tammy 35 F 68 Angela 33 F 64 Shannon 30 F 0 Ben NA M 74 Bill 42 M 69 Elizabeth 56 F 66 Susan 28 F 62 Rick 39 M 72 Becky 63 F 67
3. Now practice bringing the sample1 dataset into R using the read.csv command. a. First, set your working directory file
b. Next, upload the newly created .csv file
c. Check the data by clicking on it in the environment window. **Note the missing data for Ben s age and the 0 for Shannon s height
4. For the variable age, fill in (impute) the missing data with the mean of the variable. a. What is the variable s level of measurement?
b. Calculate the mean of the variable.
c. Then fill in the data using the impute command.
d. Now check your data again to see if the missing data has been filled in. You should see the mean for the age of Ben.
5. Create a new variable named height1 from the existing variable height.
a. What is the variable s level of measurement?
6. Remove the 0 response from your data by recoding it to be missing data (i.e., NA).
a. Calculate the median of the variable height1.
b. Fill in the missing data using the impute command
c. Now check your data to make sure that the height for Shannon has been filled in using the median for the height variable. We will now use the race variable to test our skills running frequencies.
7. Produce a frequency table for the variable race (consider reviewing the CodebookPreview the document to know what the race attributes are). a. Identify the (a) mode and (b) median for the distribution b. If you are unable to explain either the mode or the median, explain why.
8. Create a new factor variable called racerec with three categories (White, Black, Other). Note: The addition of "rec" to the end of the variable is a way to indicate that is is a recoded version of the variable. Label the three attributes accordingly.
a. Produce a frequency table for racerec.
b. Identify the mode of the distribution.
9. Describe the difference between the valid percent and full percent in a frequency distribution. [Feel free to use race and racerec as examples in your explanation.]
10. Using the variable degreerec, generate a new variable, degreerec2, that collapses "college" and "graduate school" into a single category names "College or more".
a. Produce a table of cumulative frequencies for degreerec2.
b. Identify the mode and mean of the distribution.
This Arts and Humanities Assignment has been solved by our Arts and Humanities Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.