Trying to perform Logistics Regression:
I converted the variable price to a qualitative variable.
pricecode = (ifelse(Airbnb$price >= 175, "high", "low"))
glm.fits = glm(pricecode["high"] ~ latitude + longitude + number_of_reviews + calculated_host_listings_count + availability_365, data = Airbnb, family = binomial)
summary(glm.fits)
Run code:
pricecode = (ifelse(Airbnb$price >= 175, "high", "low"))
glm.fits = glm(pricecode['high'] ~ latitude + longitude + number_of_reviews + calculated_host_listings_count + availability_365, data = Airbnb, family = binomial)
Error in model.frame.default(formula = pricecode["high"] ~ latitude + :
variable lengths differ (found for 'latitude')