Programming Homework Help
Programming Homework Help. University of Connecticut R Script Project
I’m working on a r exercise and need an explanation and answer to help me learn.
#REMEMBER THE DATA IS NAMED cdc, don’t forget to run the link first!
#Don’t forget to use $ to separate the name of the dataset and the column for some questions below ex: mean(cdc$weight) OR attach data with the code attach()
#INSTRUCTIONS
#Type the codes for each question
#Include answers to ALL questions in the script as a comment (with a #).
#Questions with a * next to it will ALSO require you to input the answer in Canvas.
#Lastly, upload this R script AND input the corresponding answers to Canvas.
#If you are missing codes or answers in this script, points will be deducted.
source(“http://www.openintro.
# 1 View the data
# *2 How many observations and variables are there?
# 3 Find the names of the variables
#Use summary code to view a summary of the age variable *Don’t forget to use $ if you didn’t attach data
# *4 What is the median age? What is the age of the youngest person in the data?
# *5 What is the height of the tallest and shortest person *Don’t forget to use $ if you didn’t attach data
# 6 Show the first 3 observations in the dataset
# 7 Show the last 5 observations in the dataset
# 8 Use the mean code to find the mean of the wtdesire column and save it as av_wtdesire *Don’t forget to use $ if you didn’t attach data
# *9 Run your item, av_wtdesire that you just created
# *10 Find the standard deviation of age and the variance of height
# 11 View a histogram of height
# *12 What class is genhlth
# 13 Create a table of hlthplan
# *14 What is the 3rd quantile of height and what does it mean? Hint: Use summary code
# 15 Find the first 3 observations of the weight column
###Normal Distribution###
# *16 Let’s assume the age a person buys their first house is normally distributed with a mean of 28 years old and a standard deviation of 7 years.
#a What is the probability that a person buys their first home younger than 24 years old?
#b What is the probability that a person buys their first home older than 35?
#c What is the probability that a person buys their first home between 20 and 37 years old?
#d What age is the cuttoff value corresponding to the top 20%?
#e What age is the cutoff value corresponding to the bottom 30%?