Replace with Main Title

Gokul

2022-02-16

## Loading required package: splines
## Loading required package: RcmdrMisc
## Loading required package: car
## Loading required package: carData
## Loading required package: sandwich
## Loading required package: effects
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
## The Commander GUI is launched only in interactive sessions
## 
## Attaching package: 'Rcmdr'
## The following object is masked from 'package:base':
## 
##     errorCondition
> Dataset <- read.table("C:/gokul/3230/Datasets/HousePrices.csv", header=TRUE,
+    stringsAsFactors=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
> densityPlot( ~ Price, data=Dataset, bw=bw.SJ, adjust=1, kernel=dnorm, 
+   method="adaptive")

> Boxplot( ~ Price, data=Dataset, id=list(method="y"))

[1] "104"
> sapply(Dataset, function(x)(sum(is.na(x)))) # NA counts
       Price         SqFt     Bedrooms    Bathrooms       Offers        Brick 
           0            0            0            0            0            0 
Neighborhood 
           0 
> library(abind, pos=19)
> local({
+   .Table <- xtabs(~Neighborhood+Brick, data=Dataset)
+   cat("\nFrequency table:\n")
+   print(.Table)
+   .Test <- chisq.test(.Table, correct=FALSE)
+   print(.Test)
+ })

Frequency table:
            Brick
Neighborhood No Yes
       East  26  19
       North 37   7
       West  23  16

    Pearson's Chi-squared test

data:  .Table
X-squared = 8.7033, df = 2, p-value = 0.01289
> .Table <- matrix(c(50,49,20,21), 2, 2, byrow=TRUE)
> dimnames(.Table) <- list("level"=c("UG", "Grad"), "habit"=c("Fic", "NF"))
> .Table  # Counts
      habit
level  Fic NF
  UG    50 49
  Grad  20 21
> .Test <- chisq.test(.Table, correct=FALSE)
> .Test

    Pearson's Chi-squared test

data:  .Table
X-squared = 0.034491, df = 1, p-value = 0.8527
> remove(.Test)
> remove(.Table)
> indexplot(Dataset[,'Price', drop=FALSE], type='h', id.method='y', id.n=2, 
+   groups=Dataset$Brick)

[1] 104 117
> with(Dataset, Dotplot(Price, bin=FALSE))

> with(Dataset, Hist(Price, scale="frequency", breaks="Scott", 
+   col="darkgray"))

> densityPlot(Price~Brick, data=Dataset, bw=bw.SJ, adjust=1, kernel=dnorm, 
+   method="adaptive")