Data 101 Quiz 4 - HW 1 Bank

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:00 PM on 4/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

Question 1 (Error)

barplot(df$price)

Barplot is inappropriate for raw numeric data; should use boxplot(df$price)

2
New cards

Question 2 (Error)

plot(df$neighborhood, df$price)

Scatterplot is not appropriate when x is categorical; should use boxplot

3
New cards

Question 3 (Error)

mean(df$neighborhood)

Cannot compute mean on a categorical variable

4
New cards

Question 4 (Error)

subset(df, price > mean(df$price) & neighborhood)

Neighborhood is used without a condition; must compare it to a value

5
New cards

Question 5 (Error)

boxplot(df$price, df$bedrooms)

Incorrect syntax; should be boxplot(price ~ bedrooms, data = df)

6
New cards

Question 6 (Error)

tapply(df$price, df$bedrooms)

Missing function argument (e.g., mean); incomplete aggregation

7
New cards

Question 7 (Error)

plot(df$price)

Produces index vs price plot; not meaningful for analysis of relationships

8
New cards

Question 8 (Error)

mean(df$price[df$bedrooms])

df$bedrooms is numeric, not logical; improper indexing

9
New cards

Question 9 (Error)

table(df$price)

Table on numerical variable creates too many categories; not meaningful

10
New cards

Question 10 (Error)

subset(df, df$price > 500000 & df$price < 100000)

Impossible condition; no values can satisfy both

11
New cards

Question 11 (Write Code)

Plot price distribution across neighborhoods.

boxplot(price ~ neighborhood, data = df)

12
New cards

Question 12 (Write Code)

Plot relationship between size and price.

plot(df$size, df$price)

13
New cards

Question 13 (Write Code)

Compute average price for each neighborhood.

tapply(df$price, df$neighborhood, mean)

14
New cards

Question 14 (Write Code)

Create subset of listings with price above average.

subset(df, price > mean(price))

15
New cards

Question 15 (Write Code)

Count number of listings per neighborhood.

table(df$neighborhood)

16
New cards

Question 16 (Interpretation)

boxplot(price ~ neighborhood, data=df)

Compares price distribution across neighborhoods, including spread and overlap

17
New cards

mean(df$price > 500000)

Proportion of listings with price above 500,000

18
New cards

Question 18 (Interpretation)

tapply(df$price, df$bedrooms, mean)

Average price for each number of bedrooms

19
New cards

Question 19 (Interpretation)

subset(df, bedrooms == 1 & price < 200000)

Listings with bedroom and price below 200,000

20
New cards

Question 20 (Interpretation)

max(df$price) - min(df$price)

Range of prices in the dataset