Below are questions to answer using R, based on the documents you just read. Enter your answers in the Rmd file, using the space provided below each question! When you are done, you should be able to click the “Knit” button and see a pretty version of your assignment.
Answer the following questions using the cdc data that
we used in the “Intro to Data” document.
Most desired weights are lower but there is a few outliers.
## run this command:
plot(cdc$weight, cdc$wtdesire, xlab="Weight", ylab="Desired weight")
wtdesire) and current weight (weight). Create
this new variable by subtracting the two columns in the data frame and
assigning them to a new object called wdiff.#wdiff <- (cdc$wtdesire - cdc$weight)
# (YOU CAN ADD LINES IF NEEDED)
wdiff? If an observation
wdiff is 0, what does this mean about the person’s weight
and desired weight. What if wdiff is positive or
negative?If it is zero then they are alreay at their desired weight. If its positive or negative then they are not at their desired weight.
# ENTER YOUR R COMMAND(S) HERE
# (YOU CAN ADD LINES IF NEEDED)
wdiff variable, using commands from the
“Intro to Data” document. What does this tell us about how people feel
about their current weight?Most people their current weight does not equal their desired weight.
# boxplot(cdc$weight ~ cdc$wtdesire)
# plot(cdc$weight, cdc$wtdesire, xlab="Weight", ylab="Desired weight")
ENTER TEXT FOR YOUR ANSWER HERE.
# boxplot(cdc$weight ~ cdc$gender)
# summary(cdc$weight)
summary(cdc$gender)
weight and determine what percentage of the weights are
within one standard deviation of the mean.Mean = 169.68 Standard Dev. = 40.08097
# mean(cdc$weight)
# sd(cdc$weight)