1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Question 1 (Error)
barplot(df$price)
Barplot is inappropriate for raw numeric data; should use boxplot(df$price)
Question 2 (Error)
plot(df$neighborhood, df$price)
Scatterplot is not appropriate when x is categorical; should use boxplot
Question 3 (Error)
mean(df$neighborhood)
Cannot compute mean on a categorical variable
Question 4 (Error)
subset(df, price > mean(df$price) & neighborhood)
Neighborhood is used without a condition; must compare it to a value
Question 5 (Error)
boxplot(df$price, df$bedrooms)
Incorrect syntax; should be boxplot(price ~ bedrooms, data = df)
Question 6 (Error)
tapply(df$price, df$bedrooms)
Missing function argument (e.g., mean); incomplete aggregation
Question 7 (Error)
plot(df$price)
Produces index vs price plot; not meaningful for analysis of relationships
Question 8 (Error)
mean(df$price[df$bedrooms])
df$bedrooms is numeric, not logical; improper indexing
Question 9 (Error)
table(df$price)
Table on numerical variable creates too many categories; not meaningful
Question 10 (Error)
subset(df, df$price > 500000 & df$price < 100000)
Impossible condition; no values can satisfy both
Question 11 (Write Code)
Plot price distribution across neighborhoods.
boxplot(price ~ neighborhood, data = df)
Question 12 (Write Code)
Plot relationship between size and price.
plot(df$size, df$price)
Question 13 (Write Code)
Compute average price for each neighborhood.
tapply(df$price, df$neighborhood, mean)
Question 14 (Write Code)
Create subset of listings with price above average.
subset(df, price > mean(price))
Question 15 (Write Code)
Count number of listings per neighborhood.
table(df$neighborhood)
Question 16 (Interpretation)
boxplot(price ~ neighborhood, data=df)
Compares price distribution across neighborhoods, including spread and overlap
mean(df$price > 500000)
Proportion of listings with price above 500,000
Question 18 (Interpretation)
tapply(df$price, df$bedrooms, mean)
Average price for each number of bedrooms
Question 19 (Interpretation)
subset(df, bedrooms == 1 & price < 200000)
Listings with bedroom and price below 200,000
Question 20 (Interpretation)
max(df$price) - min(df$price)
Range of prices in the dataset