The first thing you need to do in this file is to add your name and date in the lines underneath this document’s title (see the code in lines 9 and 10).
setwd(“C:/Users/Lance/Desktop/Methods Lab”)
You need to install and load the packages and data set you’ll use for the lab assignment in this section.
You need to calculate and describe the results of the descriptive or summary statistics identified in the lab assignment in this section.
You need to calculate and describe the means of the variables that identify the price respondents would pay for a plate of ribs and how far they would drive for BBQ in this subsection.
Ribs Price: 22.87 Respondents are willing to pay $22.87 on average for a plate of ribs Minutes Driving 40.05 Respondents are willing to drive 40.05 miles for BBQ
sapply(Week6Data, mean, na.rm=TRUE)
You need to calculate and describe the medians of the variables that identify respondents’ ages and their preferred level of sweetness in a BBQ sauce in this subsection.
Age: 21 The median age of respondents is 21 Sweetness: 3 The median level of sweetness in a BBQ sauce is 3
sapply(Week6Data, median, na.rm=TRUE)
You need to calculate and describe the modes of the variables that identify a respondent’s origin, preferred meat, and preferred sauce in this subsection. When describing these results, you need to convert the numerical modes of the different variables into words according to the survey codebook (available on AsU Learn or in the “Week6Materials” folder).
The most frequent response to a respondent’s origin is 1 (Eastern or Central NC)
The most frequent response to a respondent’s Favorite Meat’ is 1 (Pulled Pork)
The most frequent response to a respondent’s Favorite Sauce is 1 (Eastern Style with no tomato)
mfv(Week6Data$Dinner Plate Price) [1] 15
mfv(Week6Data$Hometown) [1] 1
mfv(Week6Data$Favorite Meat) [1] 1
You need to calculate and describe the ranges, maximums, and minimums of the variables that identify respondents’ ages and how many minutes they would drive for BBQ in this subsection.
The Minimum age of respondents is 10 The Maximum age of respondents is 99 The Range of respondents age is 89
The Minimum Minutes Driving is 0 minutes The Maximum Minutes Driving is 500 minutes The Range of respondents Minutes Driving is 500 minutes
max(Week6Data\(Age, na.rm = TRUE) - min(Week6Data\)Age, na.rm = TRUE) [1] 89
range(Week6Data$Age, na.rm = TRUE) [1] 10 99
range(Week6Data$
Minutes Driving,na.rm = TRUE) [1] 0 500
You need to calculate and describe the standard deviation of the variables that identify the number of minutes a respondent would drive for BBQ and the price they would pay for a plate of ribs in this subsection.
The standard deviation of minutes a respondent would drive for BBQ is 47.65 minutes The standard deviation price a respondent would pay for a plate of ribs is $10.51
sd(Week6Data\(`Minutes Driving`,na.rm = TRUE) [1] 47.65263 sd(Week6Data\)
Ribs Price,na.rm = TRUE) [1] 10.51171
Click the “Knit” button to publish your work as an html document. This document or file will appear in the folder specified by your working directory. You will need to upload both this RMarkdown file and the html file it produces to AsU Learn to get all of the lab points for this week.