EBTM 350 Summer Online Lab 1
07 June, 2025
Instructions
• Type your information below. Students with incomplete individual information will not receive a grade.
• Submit PDF report to Blackboard Lab 1 Part 1. Grades will be assigned solely to submissions
received through Blackboard.
• To receive a grade for Lab 1 Part 2, entering your solutions into the McGraw Hill Connect test.
• Those points for Part 2 will sync to the Blackboard gradebook and count toward your final grade only
if your Part 1 code supports your answers.
Student information
• Last name First name ID number
Mendoza-Martinez Angeles 0844108
Detect the missing values P47
Use the Restaurant_Reviews data to
• Detect the missing values
Following the instructions below to receive points
• Enter codes within code chunks and provide your answers in text chunks to earn points. Omitting
either will lead to a score of 0 points.
• Make sure to conclude your results as a brief summary at the end of each code chunk.
# Import data file and name it as myData
library(readxl)
myData <- read_excel("jaggia_ba_2e_ch02_data.xlsx", sheet = "Restaurant_Reviews")
# Use is.na function to returns TRUE if a missing value is detected and FALSE otherwise
is.na(myData)
# Detect missing value in the Service variable
is.na(myData$Service)
1
With correct coding from the code chunk above, you will be ready to answer questions below, which will
show up in Lab 2 Part 2 on McGraw Hill Connect. Now preview the questions and prepare your answers.
1. How many observations(i.e., restaurants) in myData? (3 points)
150
2. How many variables(i.e., columns) in myData? (3 points)
5
# Use complete.cases function to identify the rows/cases in the data that are complete
complete.cases(myData)
completeData <- myData[complete.cases(myData) , ]
# Identify observations with missing values by using the not operator (!)
notcompleteData <- myData[!complete.cases(myData) , ]
# Use the na.omit function to remove observations with missing values and store the resulting data in th
omissionData <- na.omit(myData)
Preview questions in Lab 2 Part 2:
3. How many observations(i.e., restaurants) in notcomplete? (3 points)
5
4. How many variables(i.e., columns) in notcomplete? (3 points)
5
5. How many observations(i.e., restaurants) in omissionData? (3 points)
145
6. How many variables(i.e., columns) in omissionData? (3 points)
5
7. Which restaurants have missing values? List them. (7 points)
• Service, Row 1
• Cleanliness, Row 2
• Food, Row 3
• Service, Row 4
• Ambience and Service, Row 5
To knit the Rmd document into a PDF report:
1. Use the dropdown menu of “Run” to run all to check if there are any coding errors. If no coding errors,
proceed to next steps.
2. Search for “rmarkdown” and “markdown” in Packages in the bottom right pane.
3. If you have both installed already, continue to next steps. Otherwise, manually install them first.
4. Type: tinytex::install_tinytex() into the Console.
5. Press “Enter”.
6. Wait until the stop sign disappears, then knit to PDF.
End of Lab 1
2