Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER ALL QUESTIONS It says something is wrong about my code for these questions # Q0 # Read in the train.csv file and name

PLEASE ANSWER ALL QUESTIONS

It says something is wrong about my code for these questions

# Q0 # Read in the train.csv file and name your object train.

###### Don't forget to use the strings = T argument in read.csv().

train <- read.csv("train.csv", stringsAsFactors = TRUE)

# Q7 # Use the sum() function on a logical vector to count

###### how many homes sold for more than $350,000

###### and have "Excellent" as their kitchen quality.

sum((train$SalePrice > 350000) && (train$KitchenQual == "Ex"))

# Q9 # Use the mean() function to find the average sales price

###### for a home with kitchen quality rating of "Excellent"

###### or has a garage for more than 2 cars.

mean(train$SalePrice[(train$KitchenQual == "Ex") | (train$GarageCars > 2)])

# Q10 # Use the which() function on a logical vector to find

###### the observations number(s) for a home with a

###### kitchen quality rating of "Excellent"

###### and sales price of at most $195,000.

which ((train$KitchenQual == "Ex") && (train$SalePrice <= 195000))

The 81 column names are...

Id MSSubClass MSZoning LotFrontage LotArea Street Alley LotShape LandContour Utilities LotConfig LandSlope Neighborhood Condition1 Condition2 BldgType HouseStyle OverallQual OverallCond YearBuilt YearRemodAdd RoofStyle RoofMatl Exterior1st Exterior2nd MasVnrType MasVnrArea ExterQual ExterCond Foundation BsmtQual BsmtCond BsmtExposure BsmtFinType1 BsmtFinSF1 BsmtFinType2 BsmtFinSF2 BsmtUnfSF TotalBsmtSF Heating HeatingQC CentralAir Electrical 1stFlrSF 2ndFlrSF LowQualFinSF GrLivArea BsmtFullBath BsmtHalfBath FullBath HalfBath BedroomAbvGr KitchenAbvGr KitchenQual TotRmsAbvGrd Functional Fireplaces FireplaceQu GarageType GarageYrBlt GarageFinish GarageCars GarageArea GarageQual GarageCond PavedDrive WoodDeckSF OpenPorchSF EnclosedPorch 3SsnPorch ScreenPorch PoolArea PoolQC Fence MiscFeature MiscVal MoSold YrSold SaleType SaleCondition SalePrice

PLEASE ANSWER ALL QUESTIONS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions