Description
Please download the required CSV data file here:
This assignment will focus on using some of the techniques we have seen over the past three weeks for manipulating data in R. For this assignment we will be working with a dataset consisting of demographics together with weekly religious service attendance for 5000 individuals. Most of the variable names are self-explanatory, but the “Weekly Attendance” column shows a value of “1” for those who report attending religious services weekly and “0” for those who don’t. You will read this file into R and answer a few questions that will require you to apply data transforms for finding the answer.
Important Formatting Instructions: Please round all answers to the nearest whole number. There should be no decimals or commas, only integers. Here some examples of what to do (good examples) and what NOT to do (bad examples):
Good Examples (enter examples like these): 5, 2, 22, 11, 128, 228000
Bad Examples (don’t do this!): 5.31, 2.0, 22.000, 11.88231, 128.0, 228,000
INTEGRITY STATEMENT
You must work on this entirely alone without consulting with any other student. You may certainly use your notes and any class materials as well as outside R resources, but you may NOT ask others for help or seek the answers on the Internet or from any other source. This must be entirely your own work. Additionally, you may NOT discuss these answers or in any way make them public. The Honor Code is in full effect!
HOW TO SUBMIT
Use R to answer the questions below. It is recommended to work the answers out first, then log into the website below to enter your answers. You will need to enter them all in one sitting. Please MAKE SURE to follow the formatting instructions so you don’t needlessly lose points.
Once you are ready, you may log on with your NetID and enter your answers HERE (Links to an external site.)
QUESTIONS
1. What is the mean number of years of education?
2. What is the median age?
3. How many males are in this dataset?
4. How many females are in this dataset?
5. How many married females are in this dataset?
6. How many unmarried males attend services weekly in this dataset?
7. What is the median income of those who attend services weekly?
8. What is the median income of those who DO NOT attend services weekly?
For the next 3 questions, add a new column called “HigherEd” that provides a label based on years of education according to the following rules:
- Educ < 12: “None”
- 12 <= Educ < 16: “HighSchool”
- 16 <= Educ < 17: “College”
- 17 <= Educ < 19: “Masters”
- Educ >= 19: “Doctorate”
9. What is the median income for those with HigherEd = “College”?
10. How many females with HigherEd = “Masters” in this data?
11. How many individuals who hold a doctorate attend weekly religious services?
Explanation & Answer
Hello,This is mma2959. I have finished your question with detailed explanations and I have followed all the requirements which have been stated in the questions. However, please let me know if there is anything you cannot understand so I can explain it to you.Thanks,MMA2959
QUESTIONS
1. What is the mean number of years of education?
The arithmetic mean “is the sum of all of the data points divided by the number of data points.”
This means the arithmetic mean equals the sum of the 5000 data points (75896) divided by the number of
data points (5000).
Arithmetic Mean =
75896
5000
= 15.179
Arithmetic Mean ≅ ...