I am trying to create price range and do a lm model against price range dummy variable. So I did:
> #price range
> airbnblisting$PriceRange[price <= 500] <- 0
> airbnblisting$PriceRange[price > 500 & price <= 1000] <- 1
> airbnblisting$PriceRange[price > 1000] <- 2
Then run:
> r1 <- lm(review_scores_rating ~ PriceRange, data=airbnblisting,)
> summary(r1)
But the result shows as NA for priceRange. Any idea I can get the priceRange working properly?
Min 1Q Median 3Q Max
-4.7619 -0.0319 0.1281 0.2381 0.2381
Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.761914 0.003115 1529 <2e-16 ***
PriceRange NA NA NA NA
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
price example:
$102.00
$179.00
$1140.00
$104.00
$539.00
$1090.00
$149.00
$44.00
$1500.00
$200.00
$153.00
$58.00
$350.00