getwd()
## [1] "D:/34884/Documents"
setwd("D:/34884/Documents")
# Load packages
library(ggplot2)
library(readxl)
library(stringr)
library(dplyr)
##
## 载入程序包:'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
# Read dataset
Car1<-read.csv("Car_Survey_1a.csv")
Car2<-read.csv("Car_Survey_2a.csv")
summary(Car1)
## Resp Att_1 Att_2 Enj_1
## Length:1049 Min. :1.000 Min. :1.000 Min. :1.000
## Class :character 1st Qu.:4.000 1st Qu.:4.000 1st Qu.:4.000
## Mode :character Median :6.000 Median :6.000 Median :6.000
## Mean :4.882 Mean :5.287 Mean :5.378
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:7.000
## Max. :7.000 Max. :7.000 Max. :7.000
## NA's :4 NA's :4
## Enj_2 Perform_1 Perform_2 Perform_3
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:3.000 1st Qu.:4.000 1st Qu.:4.000 1st Qu.:3.000
## Median :5.000 Median :5.000 Median :5.000 Median :5.000
## Mean :4.575 Mean :4.947 Mean :4.831 Mean :4.217
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :7.000 Max. :7.000 Max. :7.000 Max. :7.000
## NA's :4 NA's :2 NA's :4 NA's :1
## WOM_1 WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1
## Min. :1.000 Min. :1.00 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:4.000 1st Qu.:4.00 1st Qu.:4.000 1st Qu.:5.000 1st Qu.:5.000
## Median :6.000 Median :6.00 Median :6.000 Median :6.000 Median :6.000
## Mean :5.286 Mean :5.35 Mean :5.321 Mean :5.371 Mean :5.411
## 3rd Qu.:7.000 3rd Qu.:6.00 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :7.000 Max. :7.00 Max. :9.000 Max. :7.000 Max. :7.000
## NA's :1 NA's :3 NA's :5 NA's :2 NA's :4
## Valu_Percp_2 Pur_Proces_1 Pur_Proces_2 Residence
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:4.000 1st Qu.:5.000 1st Qu.:4.000 1st Qu.:1.000
## Median :5.000 Median :6.000 Median :5.000 Median :1.000
## Mean :5.114 Mean :5.256 Mean :4.923 Mean :1.474
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:2.000
## Max. :7.000 Max. :7.000 Max. :7.000 Max. :5.000
## NA's :1 NA's :3 NA's :4 NA's :5
## Pay_Meth Insur_Type Gender Age
## Min. :1.000 Length:1049 Length:1049 Min. :18.00
## 1st Qu.:1.000 Class :character Class :character 1st Qu.:23.00
## Median :2.000 Mode :character Mode :character Median :34.00
## Mean :2.153 Mean :35.22
## 3rd Qu.:3.000 3rd Qu.:48.00
## Max. :3.000 Max. :60.00
##
## Education
## Min. :1.000
## 1st Qu.:2.000
## Median :2.000
## Mean :1.989
## 3rd Qu.:2.000
## Max. :3.000
##
summary(Car2)
## Respondents Region Model MPG
## Length:1049 Length:1049 Length:1049 Min. :14.00
## Class :character Class :character Class :character 1st Qu.:17.00
## Mode :character Mode :character Mode :character Median :19.00
## Mean :19.58
## 3rd Qu.:22.00
## Max. :26.00
## Cyl acc1 C_cost. H_Cost Post.Satis
## Min. :4.0 Min. :3.600 Min. : 7.00 Min. : 6.000 Min. :2.00
## 1st Qu.:4.0 1st Qu.:5.100 1st Qu.:10.00 1st Qu.: 8.000 1st Qu.:5.00
## Median :6.0 Median :6.500 Median :12.00 Median :10.000 Median :6.00
## Mean :5.8 Mean :6.202 Mean :11.35 Mean : 9.634 Mean :5.28
## 3rd Qu.:6.0 3rd Qu.:7.500 3rd Qu.:13.00 3rd Qu.:11.000 3rd Qu.:6.00
## Max. :8.0 Max. :8.500 Max. :16.00 Max. :14.000 Max. :7.00
# Rename unique ID
names(Car2)[1]<-c("Resp")
# Merge dataset
Car_Total<-merge(Car1, Car2, by="Resp")
# Separate Model
Car_Total[c('Make', 'Model_v1')] <- str_split_fixed(Car_Total$Model, " ", 2)
mean(Car_Total$Att_1)
## [1] NA
na_rows_Att_1 <- Car_Total[is.na(Car_Total$Att_1),]
print(na_rows_Att_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 109 Res151 NA 2 NA 2 3 NA 2 2 NA
## 110 Res152 NA 5 5 4 5 6 4 5 6
## 112 Res154 NA 6 6 6 5 4 5 6 6
## 127 Res168 NA 3 3 3 6 5 3 5 6
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 109 2 2 NA 2 2 3
## 110 6 6 6 2 4 5
## 112 5 6 5 6 5 5
## 127 6 7 5 3 5 4
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 109 1 2 Comprehensive Female 21 2 American
## 110 2 1 Comprehensive Female 21 2 American
## 112 2 2 Comprehensive Female 23 2 American
## 127 1 2 Collision Male 29 2 Asian
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make
## 109 Chrysler Jeep 18 6 3.6 12 10.0 4 Chrysler
## 110 Chrysler Jeep 18 6 3.6 12 10.0 6 Chrysler
## 112 Chrysler Jeep 18 6 3.6 12 10.0 6 Chrysler
## 127 Toyota Highlander 20 6 7.2 10 8.5 6 Toyota
## Model_v1
## 109 Jeep
## 110 Jeep
## 112 Jeep
## 127 Highlander
meanATT1<-mean(Car_Total$Att_1,na.rm=TRUE)
print(meanATT1)
## [1] 4.882297
Car_Total[is.na(Car_Total$Att_1), "Att_1"] <- meanATT1
Car_Total[c(rownames(na_rows_Att_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 109 Res151 4.882297 2 NA 2 3 NA 2 2 NA
## 110 Res152 4.882297 5 5 4 5 6 4 5 6
## 112 Res154 4.882297 6 6 6 5 4 5 6 6
## 127 Res168 4.882297 3 3 3 6 5 3 5 6
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 109 2 2 NA 2 2 3
## 110 6 6 6 2 4 5
## 112 5 6 5 6 5 5
## 127 6 7 5 3 5 4
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 109 1 2 Comprehensive Female 21 2 American
## 110 2 1 Comprehensive Female 21 2 American
## 112 2 2 Comprehensive Female 23 2 American
## 127 1 2 Collision Male 29 2 Asian
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make
## 109 Chrysler Jeep 18 6 3.6 12 10.0 4 Chrysler
## 110 Chrysler Jeep 18 6 3.6 12 10.0 6 Chrysler
## 112 Chrysler Jeep 18 6 3.6 12 10.0 6 Chrysler
## 127 Toyota Highlander 20 6 7.2 10 8.5 6 Toyota
## Model_v1
## 109 Jeep
## 110 Jeep
## 112 Jeep
## 127 Highlander
mean(Car_Total$Att_2)
## [1] 5.28694
na_rows_Att_2 <- Car_Total[is.na(Car_Total$Att_2),]
print(na_rows_Att_2)
## [1] Resp Att_1 Att_2 Enj_1 Enj_2
## [6] Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## [11] Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## [16] Pur_Proces_2 Residence Pay_Meth Insur_Type Gender
## [21] Age Education Region Model MPG
## [26] Cyl acc1 C_cost. H_Cost Post.Satis
## [31] Make Model_v1
## <0 行> (或0-长度的row.names)
mean(Car_Total$Enj_1)
## [1] NA
na_rows_Enj_1 <- Car_Total[is.na(Car_Total$Enj_1),]
print(na_rows_Enj_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 73 Res119 6.000000 6 NA 5 4 4 4 4 4
## 109 Res151 4.882297 2 NA 2 3 NA 2 2 NA
## 113 Res155 5.000000 5 NA 5 4 4 1 7 7
## 917 Res88 7.000000 7 NA NA 7 7 5 7 6
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 73 4 5 5 4 3 2
## 109 2 2 NA 2 2 3
## 113 5 5 5 5 5 4
## 917 NA 5 5 4 5 5
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 73 2 3 Liability Female 45 2 American
## 109 1 2 Comprehensive Female 21 2 American
## 113 1 3 Comprehensive Male 23 1 American
## 917 1 2 Collision Female 24 1 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 73 Toyota Rav4 24 4 8.2 10 8 5 Toyota Rav4
## 109 Chrysler Jeep 18 6 3.6 12 10 4 Chrysler Jeep
## 113 Chrysler Jeep 18 6 3.6 12 10 6 Chrysler Jeep
## 917 Honda CRV 26 4 8.5 8 7 4 Honda CRV
meanEnj1<-mean(Car_Total$Enj_1,na.rm=TRUE)
print(meanEnj1)
## [1] 5.37799
Car_Total[is.na(Car_Total$Enj_1), "Enj_1"] <- meanEnj1
Car_Total[c(rownames(na_rows_Enj_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 73 Res119 6.000000 6 5.37799 5 4 4 4 4
## 109 Res151 4.882297 2 5.37799 2 3 NA 2 2
## 113 Res155 5.000000 5 5.37799 5 4 4 1 7
## 917 Res88 7.000000 7 5.37799 NA 7 7 5 7
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 73 4 4 5 5 4 3
## 109 NA 2 2 NA 2 2
## 113 7 5 5 5 5 5
## 917 6 NA 5 5 4 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education Region
## 73 2 2 3 Liability Female 45 2 American
## 109 3 1 2 Comprehensive Female 21 2 American
## 113 4 1 3 Comprehensive Male 23 1 American
## 917 5 1 2 Collision Female 24 1 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 73 Toyota Rav4 24 4 8.2 10 8 5 Toyota Rav4
## 109 Chrysler Jeep 18 6 3.6 12 10 4 Chrysler Jeep
## 113 Chrysler Jeep 18 6 3.6 12 10 6 Chrysler Jeep
## 917 Honda CRV 26 4 8.5 8 7 4 Honda CRV
mean(Car_Total$Enj_2)
## [1] NA
na_rows_Enj_2 <- Car_Total[is.na(Car_Total$Enj_2),]
print(na_rows_Enj_2)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 165 Res201 4 4 5.00000 NA 6 5 1 7 7
## 188 Res222 6 3 4.00000 NA 6 6 4 6 7
## 917 Res88 7 7 5.37799 NA 7 7 5 7 6
## 1006 Res96 7 7 6.00000 NA 6 6 6 7 6
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 165 6 6 6 7 7 7
## 188 7 7 6 6 7 2
## 917 NA 5 5 4 5 5
## 1006 6 7 NA 5 7 3
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 165 2 1 Comprehensive Male 55 2 American
## 188 2 3 Liability Female 21 2 European
## 917 1 2 Collision Female 24 1 American
## 1006 1 1 Collision Female 27 1 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 165 Ford Explorer 19 6 6.0 13 11 6 Ford Explorer
## 188 Toyota Rav4 24 4 8.2 10 8 5 Toyota Rav4
## 917 Honda CRV 26 4 8.5 8 7 4 Honda CRV
## 1006 Toyota Rav4 24 4 8.2 10 8 6 Toyota Rav4
meanEnj2<-mean(Car_Total$Enj_2,na.rm=TRUE)
print(meanEnj2)
## [1] 4.57512
Car_Total[is.na(Car_Total$Enj_2), "Enj_2"] <- meanEnj2
Car_Total[c(rownames(na_rows_Enj_2)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 165 Res201 4 4 5.00000 4.57512 6 5 1 7
## 188 Res222 6 3 4.00000 4.57512 6 6 4 6
## 917 Res88 7 7 5.37799 4.57512 7 7 5 7
## 1006 Res96 7 7 6.00000 4.57512 6 6 6 7
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 165 7 6 6 6 7 7
## 188 7 7 7 6 6 7
## 917 6 NA 5 5 4 5
## 1006 6 6 7 NA 5 7
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education
## 165 7 2 1 Comprehensive Male 55 2
## 188 2 2 3 Liability Female 21 2
## 917 5 1 2 Collision Female 24 1
## 1006 3 1 1 Collision Female 27 1
## Region Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make
## 165 American Ford Explorer 19 6 6.0 13 11 6 Ford
## 188 European Toyota Rav4 24 4 8.2 10 8 5 Toyota
## 917 American Honda CRV 26 4 8.5 8 7 4 Honda
## 1006 American Toyota Rav4 24 4 8.2 10 8 6 Toyota
## Model_v1
## 165 Explorer
## 188 Rav4
## 917 CRV
## 1006 Rav4
mean(Car_Total$Perform_1)
## [1] NA
na_rows_Perform_1 <- Car_Total[is.na(Car_Total$Perform_1),]
print(na_rows_Perform_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 119 Res160 4 5 4 6 NA 6 3 6 7
## 873 Res84 6 6 6 6 NA NA 5 5 NA
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 119 3 5 3 6 6 2
## 873 NA 6 6 5 5 6
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 119 1 3 Comprehensive Male 24 1 Middle Eastern
## 873 2 1 Collision Male 23 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 119 Chrysler Jeep 18 6 3.6 12 10 4 Chrysler Jeep
## 873 Honda CRV 26 4 8.5 8 7 4 Honda CRV
meanPerform1<-mean(Car_Total$Perform_1,na.rm=TRUE)
print(meanPerform1)
## [1] 4.946514
Car_Total[is.na(Car_Total$Perform_1), "Perform_1"] <- meanPerform1
Car_Total[c(rownames(na_rows_Perform_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 119 Res160 4 5 4 6 4.946514 6 3 6 7
## 873 Res84 6 6 6 6 4.946514 NA 5 5 NA
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 119 3 5 3 6 6 2
## 873 NA 6 6 5 5 6
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 119 1 3 Comprehensive Male 24 1 Middle Eastern
## 873 2 1 Collision Male 23 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 119 Chrysler Jeep 18 6 3.6 12 10 4 Chrysler Jeep
## 873 Honda CRV 26 4 8.5 8 7 4 Honda CRV
mean(Car_Total$Perform_2)
## [1] NA
na_rows_Perform_2 <- Car_Total[is.na(Car_Total$Perform_2),]
print(na_rows_Perform_2)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 57 Res1049 3.000000 4 4.00000 5 5.000000 NA 5 4
## 109 Res151 4.882297 2 5.37799 2 3.000000 NA 2 2
## 396 Res41 1.000000 1 1.00000 1 1.000000 NA 1 1
## 873 Res84 6.000000 6 6.00000 6 4.946514 NA 5 5
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 57 5 4 4 7 5 5
## 109 NA 2 2 NA 2 2
## 396 1 3 3 2 2 2
## 873 NA NA 6 6 5 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education Region
## 57 6 2 1 Collision Female 21 2 European
## 109 3 1 2 Comprehensive Female 21 2 American
## 396 5 2 2 Collision Male 36 2 American
## 873 6 2 1 Collision Male 23 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 57 Fiat 500x 22 4 8.00 8 6 5 Fiat 500x
## 109 Chrysler Jeep 18 6 3.60 12 10 4 Chrysler Jeep
## 396 Dodge Journey 16 6 5.75 12 11 4 Dodge Journey
## 873 Honda CRV 26 4 8.50 8 7 4 Honda CRV
meanPerform2<-mean(Car_Total$Perform_2,na.rm=TRUE)
print(meanPerform2)
## [1] 4.830622
Car_Total[is.na(Car_Total$Perform_2), "Perform_2"] <- meanPerform2
Car_Total[c(rownames(na_rows_Perform_2)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 57 Res1049 3.000000 4 4.00000 5 5.000000 4.830622 5 4
## 109 Res151 4.882297 2 5.37799 2 3.000000 4.830622 2 2
## 396 Res41 1.000000 1 1.00000 1 1.000000 4.830622 1 1
## 873 Res84 6.000000 6 6.00000 6 4.946514 4.830622 5 5
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 57 5 4 4 7 5 5
## 109 NA 2 2 NA 2 2
## 396 1 3 3 2 2 2
## 873 NA NA 6 6 5 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education Region
## 57 6 2 1 Collision Female 21 2 European
## 109 3 1 2 Comprehensive Female 21 2 American
## 396 5 2 2 Collision Male 36 2 American
## 873 6 2 1 Collision Male 23 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 57 Fiat 500x 22 4 8.00 8 6 5 Fiat 500x
## 109 Chrysler Jeep 18 6 3.60 12 10 4 Chrysler Jeep
## 396 Dodge Journey 16 6 5.75 12 11 4 Dodge Journey
## 873 Honda CRV 26 4 8.50 8 7 4 Honda CRV
mean(Car_Total$Perform_3)
## [1] NA
na_rows_Perform_3 <- Car_Total[is.na(Car_Total$Perform_3),]
print(na_rows_Perform_3)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 NA NA 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 NA NA NA NA NA NA
## Residence Pay_Meth Insur_Type Gender Age Education Region Model MPG
## 62 1 3 Liability Male 36 2 American Toyota Rav4 24
## Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 4 8.2 10 8 3 Toyota Rav4
meanPerform3<-mean(Car_Total$Perform_3,na.rm=TRUE)
print(meanPerform3)
## [1] 4.216603
Car_Total[is.na(Car_Total$Perform_3), "Perform_3"] <- meanPerform3
Car_Total[c(rownames(na_rows_Perform_3)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 NA 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 NA NA NA NA NA NA
## Residence Pay_Meth Insur_Type Gender Age Education Region Model MPG
## 62 1 3 Liability Male 36 2 American Toyota Rav4 24
## Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 4 8.2 10 8 3 Toyota Rav4
mean(Car_Total$WOM_1)
## [1] NA
na_rows_WOM_1 <- Car_Total[is.na(Car_Total$WOM_1),]
print(na_rows_WOM_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 NA 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 NA NA NA NA NA NA
## Residence Pay_Meth Insur_Type Gender Age Education Region Model MPG
## 62 1 3 Liability Male 36 2 American Toyota Rav4 24
## Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 4 8.2 10 8 3 Toyota Rav4
meanWOM1<-mean(Car_Total$WOM_1,na.rm=TRUE)
print(meanWOM1)
## [1] 5.28626
Car_Total[is.na(Car_Total$WOM_1), "WOM_1"] <- meanWOM1
Car_Total[c(rownames(na_rows_WOM_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 NA NA NA NA NA NA
## Residence Pay_Meth Insur_Type Gender Age Education Region Model MPG
## 62 1 3 Liability Male 36 2 American Toyota Rav4 24
## Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 4 8.2 10 8 3 Toyota Rav4
mean(Car_Total$WOM_2)
## [1] NA
na_rows_WOM_2 <- Car_Total[is.na(Car_Total$WOM_2),]
print(na_rows_WOM_2)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 109 Res151 4.882297 2 5.37799 2 3.000000 4.830622 2 2
## 462 Res47 6.000000 5 5.00000 4 5.000000 4.000000 7 5
## 873 Res84 6.000000 6 6.00000 6 4.946514 4.830622 5 5
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 109 NA 2 2 NA 2 2
## 462 NA 5 6 5 3 3
## 873 NA NA 6 6 5 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education Region
## 109 3 1 2 Comprehensive Female 21 2 American
## 462 6 2 1 Comprehensive Female 42 1 American
## 873 6 2 1 Collision Male 23 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 109 Chrysler Jeep 18 6 3.6 12 10 4 Chrysler Jeep
## 462 Ford Expedition 15 8 5.5 16 14 5 Ford Expedition
## 873 Honda CRV 26 4 8.5 8 7 4 Honda CRV
meanWOM2<-mean(Car_Total$WOM_2,na.rm=TRUE)
print(meanWOM2)
## [1] 5.349904
Car_Total[is.na(Car_Total$WOM_2), "WOM_2"] <- meanWOM2
Car_Total[c(rownames(na_rows_WOM_2)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 109 Res151 4.882297 2 5.37799 2 3.000000 4.830622 2 2
## 462 Res47 6.000000 5 5.00000 4 5.000000 4.000000 7 5
## 873 Res84 6.000000 6 6.00000 6 4.946514 4.830622 5 5
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 109 5.349904 2 2 NA 2 2
## 462 5.349904 5 6 5 3 3
## 873 5.349904 NA 6 6 5 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education Region
## 109 3 1 2 Comprehensive Female 21 2 American
## 462 6 2 1 Comprehensive Female 42 1 American
## 873 6 2 1 Collision Male 23 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 109 Chrysler Jeep 18 6 3.6 12 10 4 Chrysler Jeep
## 462 Ford Expedition 15 8 5.5 16 14 5 Ford Expedition
## 873 Honda CRV 26 4 8.5 8 7 4 Honda CRV
mean(Car_Total$Futu_Pur_1)
## [1] NA
na_rows_Futu_Pur_1 <- Car_Total[is.na(Car_Total$Futu_Pur_1),]
print(na_rows_Futu_Pur_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 62 Res109 6 6 6.00000 5.00000 5.000000 6.000000 4.216603 5.28626
## 120 Res161 6 6 6.00000 3.00000 5.000000 1.000000 4.000000 5.00000
## 181 Res216 5 6 6.00000 7.00000 7.000000 4.000000 4.000000 5.00000
## 873 Res84 6 6 6.00000 6.00000 4.946514 4.830622 5.000000 5.00000
## 917 Res88 7 7 5.37799 4.57512 7.000000 7.000000 5.000000 7.00000
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 62 4.000000 NA NA NA NA NA
## 120 5.000000 NA 5 5 6 5
## 181 5.000000 NA 6 5 5 5
## 873 5.349904 NA 6 6 5 5
## 917 6.000000 NA 5 5 4 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education
## 62 NA 1 3 Liability Male 36 2
## 120 5 1 3 Comprehensive Male 24 3
## 181 5 2 1 Liability Male 19 3
## 873 6 2 1 Collision Male 23 2
## 917 5 1 2 Collision Female 24 1
## Region Model MPG Cyl acc1 C_cost. H_Cost Post.Satis
## 62 American Toyota Rav4 24 4 8.2 10 8 3
## 120 Middle Eastern Chrysler Jeep 18 6 3.6 12 10 4
## 181 American Toyota Rav4 24 4 8.2 10 8 6
## 873 American Honda CRV 26 4 8.5 8 7 4
## 917 American Honda CRV 26 4 8.5 8 7 4
## Make Model_v1
## 62 Toyota Rav4
## 120 Chrysler Jeep
## 181 Toyota Rav4
## 873 Honda CRV
## 917 Honda CRV
meanFutu1<-mean(Car_Total$Futu_Pur_1,na.rm=TRUE)
print(meanFutu1)
## [1] 5.320881
Car_Total[is.na(Car_Total$Futu_Pur_1), "Futu_Pur_1"] <- meanFutu1
Car_Total[c(rownames(na_rows_Futu_Pur_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1
## 62 Res109 6 6 6.00000 5.00000 5.000000 6.000000 4.216603 5.28626
## 120 Res161 6 6 6.00000 3.00000 5.000000 1.000000 4.000000 5.00000
## 181 Res216 5 6 6.00000 7.00000 7.000000 4.000000 4.000000 5.00000
## 873 Res84 6 6 6.00000 6.00000 4.946514 4.830622 5.000000 5.00000
## 917 Res88 7 7 5.37799 4.57512 7.000000 7.000000 5.000000 7.00000
## WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1
## 62 4.000000 5.320881 NA NA NA NA
## 120 5.000000 5.320881 5 5 6 5
## 181 5.000000 5.320881 6 5 5 5
## 873 5.349904 5.320881 6 6 5 5
## 917 6.000000 5.320881 5 5 4 5
## Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age Education
## 62 NA 1 3 Liability Male 36 2
## 120 5 1 3 Comprehensive Male 24 3
## 181 5 2 1 Liability Male 19 3
## 873 6 2 1 Collision Male 23 2
## 917 5 1 2 Collision Female 24 1
## Region Model MPG Cyl acc1 C_cost. H_Cost Post.Satis
## 62 American Toyota Rav4 24 4 8.2 10 8 3
## 120 Middle Eastern Chrysler Jeep 18 6 3.6 12 10 4
## 181 American Toyota Rav4 24 4 8.2 10 8 6
## 873 American Honda CRV 26 4 8.5 8 7 4
## 917 American Honda CRV 26 4 8.5 8 7 4
## Make Model_v1
## 62 Toyota Rav4
## 120 Chrysler Jeep
## 181 Toyota Rav4
## 873 Honda CRV
## 917 Honda CRV
mean(Car_Total$Futu_Pur_2)
## [1] NA
na_rows_Futu_Pur_2 <- Car_Total[is.na(Car_Total$Futu_Pur_2),]
print(na_rows_Futu_Pur_2)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## 507 Res51 4 4 4 1 2 3 3.000000 3.00000 3
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 NA NA NA NA NA
## 507 2.000000 NA 2 2 2 6
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 62 1 3 Liability Male 36 2 American
## 507 2 1 Comprehensive Male 48 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 Toyota Rav4 24 4 8.2 10 8 3 Toyota Rav4
## 507 Ford Expedition 15 8 5.5 16 14 4 Ford Expedition
meanFutu2<-mean(Car_Total$Futu_Pur_2,na.rm=TRUE)
print(meanFutu2)
## [1] 5.370583
Car_Total[is.na(Car_Total$Futu_Pur_2), "Futu_Pur_2"] <- meanFutu2
Car_Total[c(rownames(na_rows_Futu_Pur_2)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## 507 Res51 4 4 4 1 2 3 3.000000 3.00000 3
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 NA NA NA NA
## 507 2.000000 5.370583 2 2 2 6
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 62 1 3 Liability Male 36 2 American
## 507 2 1 Comprehensive Male 48 2 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 Toyota Rav4 24 4 8.2 10 8 3 Toyota Rav4
## 507 Ford Expedition 15 8 5.5 16 14 4 Ford Expedition
mean(Car_Total$Valu_Percp_1)
## [1] NA
na_rows_Valu_Percp_1 <- Car_Total[is.na(Car_Total$Valu_Percp_1),]
print(na_rows_Valu_Percp_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3
## 62 Res109 6.000000 6 6.00000 5.00000 5 6.000000 4.216603
## 109 Res151 4.882297 2 5.37799 2.00000 3 4.830622 2.000000
## 178 Res213 6.000000 2 3.00000 3.00000 5 6.000000 4.000000
## 1006 Res96 7.000000 7 6.00000 4.57512 6 6.000000 6.000000
## WOM_1 WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2
## 62 5.28626 4.000000 5.320881 5.370583 NA NA
## 109 2.00000 5.349904 2.000000 2.000000 NA 2
## 178 7.00000 7.000000 7.000000 7.000000 NA 6
## 1006 7.00000 6.000000 6.000000 7.000000 NA 5
## Pur_Proces_1 Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age
## 62 NA NA 1 3 Liability Male 36
## 109 2 3 1 2 Comprehensive Female 21
## 178 7 2 1 1 Liability Male 19
## 1006 7 3 1 1 Collision Female 27
## Education Region Model MPG Cyl acc1 C_cost. H_Cost Post.Satis
## 62 2 American Toyota Rav4 24 4 8.2 10 8 3
## 109 2 American Chrysler Jeep 18 6 3.6 12 10 4
## 178 1 American Toyota Rav4 24 4 8.2 10 8 7
## 1006 1 American Toyota Rav4 24 4 8.2 10 8 6
## Make Model_v1
## 62 Toyota Rav4
## 109 Chrysler Jeep
## 178 Toyota Rav4
## 1006 Toyota Rav4
meanValu1<-mean(Car_Total$Valu_Percp_1,na.rm=TRUE)
print(meanValu1)
## [1] 5.411483
Car_Total[is.na(Car_Total$Valu_Percp_1), "Valu_Percp_1"] <- meanValu1
Car_Total[c(rownames(na_rows_Valu_Percp_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3
## 62 Res109 6.000000 6 6.00000 5.00000 5 6.000000 4.216603
## 109 Res151 4.882297 2 5.37799 2.00000 3 4.830622 2.000000
## 178 Res213 6.000000 2 3.00000 3.00000 5 6.000000 4.000000
## 1006 Res96 7.000000 7 6.00000 4.57512 6 6.000000 6.000000
## WOM_1 WOM_2 Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2
## 62 5.28626 4.000000 5.320881 5.370583 5.411483 NA
## 109 2.00000 5.349904 2.000000 2.000000 5.411483 2
## 178 7.00000 7.000000 7.000000 7.000000 5.411483 6
## 1006 7.00000 6.000000 6.000000 7.000000 5.411483 5
## Pur_Proces_1 Pur_Proces_2 Residence Pay_Meth Insur_Type Gender Age
## 62 NA NA 1 3 Liability Male 36
## 109 2 3 1 2 Comprehensive Female 21
## 178 7 2 1 1 Liability Male 19
## 1006 7 3 1 1 Collision Female 27
## Education Region Model MPG Cyl acc1 C_cost. H_Cost Post.Satis
## 62 2 American Toyota Rav4 24 4 8.2 10 8 3
## 109 2 American Chrysler Jeep 18 6 3.6 12 10 4
## 178 1 American Toyota Rav4 24 4 8.2 10 8 7
## 1006 1 American Toyota Rav4 24 4 8.2 10 8 6
## Make Model_v1
## 62 Toyota Rav4
## 109 Chrysler Jeep
## 178 Toyota Rav4
## 1006 Toyota Rav4
mean(Car_Total$Valu_Percp_2)
## [1] NA
na_rows_Valu_Percp_2 <- Car_Total[is.na(Car_Total$Valu_Percp_2),]
print(na_rows_Valu_Percp_2)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 5.411483 NA NA NA
## Residence Pay_Meth Insur_Type Gender Age Education Region Model MPG
## 62 1 3 Liability Male 36 2 American Toyota Rav4 24
## Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 4 8.2 10 8 3 Toyota Rav4
meanValu2<-mean(Car_Total$Valu_Percp_2,na.rm=TRUE)
print(meanValu2)
## [1] 5.11355
Car_Total[is.na(Car_Total$Valu_Percp_2), "Valu_Percp_2"] <- meanValu2
Car_Total[c(rownames(na_rows_Valu_Percp_2)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 5.411483 5.11355 NA NA
## Residence Pay_Meth Insur_Type Gender Age Education Region Model MPG
## 62 1 3 Liability Male 36 2 American Toyota Rav4 24
## Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 4 8.2 10 8 3 Toyota Rav4
mean(Car_Total$Pur_Proces_1)
## [1] NA
na_rows_Pur_Proces_1 <- Car_Total[is.na(Car_Total$Pur_Proces_1),]
print(na_rows_Pur_Proces_1)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## 136 Res176 3 6 6 5 5 6 7.000000 6.00000 6
## 806 Res78 7 6 7 7 7 7 5.000000 3.00000 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 5.411483 5.11355 NA NA
## 136 4.000000 4.000000 4.000000 1.00000 NA NA
## 806 6.000000 7.000000 6.000000 7.00000 NA 7
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 62 1 3 Liability Male 36 2 American
## 136 1 1 Collision Female 34 1 Asian
## 806 2 3 Liability Male 21 2 Asian
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 Toyota Rav4 24 4 8.2 10 8.0 3 Toyota Rav4
## 136 Toyota Highlander 20 6 7.2 10 8.5 6 Toyota Highlander
## 806 Honda CRV 26 4 8.5 8 7.0 6 Honda CRV
meanPur1<-mean(Car_Total$Pur_Proces_1,na.rm=TRUE)
print(meanPur1)
## [1] 5.256214
Car_Total[is.na(Car_Total$Pur_Proces_1), "Pur_Proces_1"] <- meanPur1
Car_Total[c(rownames(na_rows_Pur_Proces_1)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## 136 Res176 3 6 6 5 5 6 7.000000 6.00000 6
## 806 Res78 7 6 7 7 7 7 5.000000 3.00000 4
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 5.411483 5.11355 5.256214 NA
## 136 4.000000 4.000000 4.000000 1.00000 5.256214 NA
## 806 6.000000 7.000000 6.000000 7.00000 5.256214 7
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 62 1 3 Liability Male 36 2 American
## 136 1 1 Collision Female 34 1 Asian
## 806 2 3 Liability Male 21 2 Asian
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make Model_v1
## 62 Toyota Rav4 24 4 8.2 10 8.0 3 Toyota Rav4
## 136 Toyota Highlander 20 6 7.2 10 8.5 6 Toyota Highlander
## 806 Honda CRV 26 4 8.5 8 7.0 6 Honda CRV
mean(Car_Total$Pur_Proces_2)
## [1] NA
na_rows_Pur_Proces_2 <- Car_Total[is.na(Car_Total$Pur_Proces_2),]
print(na_rows_Pur_Proces_2)
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## 115 Res157 2 2 2 2 3 2 2.000000 2.00000 2
## 136 Res176 3 6 6 5 5 6 7.000000 6.00000 6
## 163 Res20 7 7 6 6 6 5 1.000000 6.00000 6
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 5.411483 5.11355 5.256214 NA
## 115 2.000000 2.000000 2.000000 2.00000 2.000000 NA
## 136 4.000000 4.000000 4.000000 1.00000 5.256214 NA
## 163 5.000000 5.000000 3.000000 3.00000 4.000000 NA
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 62 1 3 Liability Male 36 2 American
## 115 2 3 Comprehensive Male 23 1 Middle Eastern
## 136 1 1 Collision Female 34 1 Asian
## 163 1 2 Collision Female 24 3 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make
## 62 Toyota Rav4 24 4 8.2 10 8.0 3 Toyota
## 115 Chrysler Jeep 18 6 3.6 12 10.0 4 Chrysler
## 136 Toyota Highlander 20 6 7.2 10 8.5 6 Toyota
## 163 Ford Expedition 15 8 5.5 16 14.0 6 Ford
## Model_v1
## 62 Rav4
## 115 Jeep
## 136 Highlander
## 163 Expedition
meanPur2<-mean(Car_Total$Pur_Proces_2,na.rm=TRUE)
print(meanPur2)
## [1] 4.923445
Car_Total[is.na(Car_Total$Pur_Proces_2), "Pur_Proces_2"] <- meanPur2
Car_Total[c(rownames(na_rows_Pur_Proces_2)),]
## Resp Att_1 Att_2 Enj_1 Enj_2 Perform_1 Perform_2 Perform_3 WOM_1 WOM_2
## 62 Res109 6 6 6 5 5 6 4.216603 5.28626 4
## 115 Res157 2 2 2 2 3 2 2.000000 2.00000 2
## 136 Res176 3 6 6 5 5 6 7.000000 6.00000 6
## 163 Res20 7 7 6 6 6 5 1.000000 6.00000 6
## Futu_Pur_1 Futu_Pur_2 Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## 62 5.320881 5.370583 5.411483 5.11355 5.256214 4.923445
## 115 2.000000 2.000000 2.000000 2.00000 2.000000 4.923445
## 136 4.000000 4.000000 4.000000 1.00000 5.256214 4.923445
## 163 5.000000 5.000000 3.000000 3.00000 4.000000 4.923445
## Residence Pay_Meth Insur_Type Gender Age Education Region
## 62 1 3 Liability Male 36 2 American
## 115 2 3 Comprehensive Male 23 1 Middle Eastern
## 136 1 1 Collision Female 34 1 Asian
## 163 1 2 Collision Female 24 3 American
## Model MPG Cyl acc1 C_cost. H_Cost Post.Satis Make
## 62 Toyota Rav4 24 4 8.2 10 8.0 3 Toyota
## 115 Chrysler Jeep 18 6 3.6 12 10.0 4 Chrysler
## 136 Toyota Highlander 20 6 7.2 10 8.5 6 Toyota
## 163 Ford Expedition 15 8 5.5 16 14.0 6 Ford
## Model_v1
## 62 Rav4
## 115 Jeep
## 136 Highlander
## 163 Expedition
Car_Total$Att_Mean = (Car_Total$Att_1 +
Car_Total$Att_2) / 2
Car_Total$Enj_Mean = (Car_Total$Enj_1 +
Car_Total$Enj_2) / 2
Car_Total$Perform_Mean = (Car_Total$Perform_1 +
Car_Total$Perform_2 +
Car_Total$Perform_3) / 3
Car_Total$WOM_Mean = (Car_Total$WOM_1 +
Car_Total$WOM_2) / 2
Car_Total$Futu_Pur_Mean = (Car_Total$Futu_Pur_1 +
Car_Total$Futu_Pur_2) / 2
Car_Total$Valu_Percp_Mean = (Car_Total$Valu_Percp_1 +
Car_Total$Valu_Percp_2) / 2
Car_Total$Pur_Proces_Mean = (Car_Total$Pur_Proces_1 +
Car_Total$Pur_Proces_2) / 2
Car_Total$AttGrp<-cut(Car_Total$Att_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
head(Car_Total$AttGrp)
## [1] [6,7) [6,7) [6,7) [6,7) [6,7) [2,3)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
Car_Total$EnjGrp<-cut(Car_Total$Enj_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp"
head(Car_Total$EnjGrp)
## [1] [6,7) [4,5) [5,6) [6,7) [6,7) [3,4)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
Car_Total$PerformGrp<-cut(Car_Total$Perform_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp" "PerformGrp"
head(Car_Total$PerformGrp)
## [1] [4,5) [3,4) [5,6) [6,7) [6,7) [5,6)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
Car_Total$WOMGrp<-cut(Car_Total$WOM_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp" "PerformGrp" "WOMGrp"
head(Car_Total$WOMGrp)
## [1] [3,4) [5,6) [4,5) [6,7) [4,5) [4,5)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
Car_Total$FutuGrp<-cut(Car_Total$Futu_Pur_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp" "PerformGrp" "WOMGrp" "FutuGrp"
head(Car_Total$FutuGrp)
## [1] [3,4) [6,7) [6,7) [6,7) [5,6) [6,7)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
Car_Total$ValuGrp<-cut(Car_Total$Valu_Percp_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp" "PerformGrp" "WOMGrp" "FutuGrp"
## [45] "ValuGrp"
head(Car_Total$ValuGrp)
## [1] [3,4) [6,7) [6,7) [5,6) [5,6) [4,5)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
Car_Total$PurGrp<-cut(Car_Total$Pur_Proces_Mean,
breaks = c(0, 1, 2, 3, 4, 5, 6, 7, Inf),
Labels = c("0+", "1+", "2+", "3+", "4+", "5+", "6+", "7"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp" "PerformGrp" "WOMGrp" "FutuGrp"
## [45] "ValuGrp" "PurGrp"
head(Car_Total$PurGrp)
## [1] [5,6) [6,7) [5,6) [4,5) [6,7) [5,6)
## Levels: [0,1) [1,2) [2,3) [3,4) [4,5) [5,6) [6,7) [7,Inf)
summary(Car_Total$Age)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 18.00 23.00 34.00 35.22 48.00 60.00
Car_Total$AgeGrp<-cut(Car_Total$Age,
breaks = c(18, 30, 42, 54, Inf),
Labels = c("18-30", "30-42", "42-54", "54+"),
right=FALSE)
names(Car_Total)
## [1] "Resp" "Att_1" "Att_2" "Enj_1"
## [5] "Enj_2" "Perform_1" "Perform_2" "Perform_3"
## [9] "WOM_1" "WOM_2" "Futu_Pur_1" "Futu_Pur_2"
## [13] "Valu_Percp_1" "Valu_Percp_2" "Pur_Proces_1" "Pur_Proces_2"
## [17] "Residence" "Pay_Meth" "Insur_Type" "Gender"
## [21] "Age" "Education" "Region" "Model"
## [25] "MPG" "Cyl" "acc1" "C_cost."
## [29] "H_Cost" "Post.Satis" "Make" "Model_v1"
## [33] "Att_Mean" "Enj_Mean" "Perform_Mean" "WOM_Mean"
## [37] "Futu_Pur_Mean" "Valu_Percp_Mean" "Pur_Proces_Mean" "AttGrp"
## [41] "EnjGrp" "PerformGrp" "WOMGrp" "FutuGrp"
## [45] "ValuGrp" "PurGrp" "AgeGrp"
head(Car_Total$AgeGrp)
## [1] [18,30) [18,30) [30,42) [18,30) [18,30) [18,30)
## Levels: [18,30) [30,42) [42,54) [54,Inf)
Toyota = Car_Total %>% filter(Make == "Toyota")
summary(Toyota)
## Resp Att_1 Att_2 Enj_1
## Length:292 Min. :1.000 Min. :1.000 Min. :1.000
## Class :character 1st Qu.:4.000 1st Qu.:5.000 1st Qu.:5.000
## Mode :character Median :6.000 Median :6.000 Median :6.000
## Mean :5.003 Mean :5.507 Mean :5.583
## 3rd Qu.:6.000 3rd Qu.:7.000 3rd Qu.:7.000
## Max. :7.000 Max. :7.000 Max. :7.000
##
## Enj_2 Perform_1 Perform_2 Perform_3
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:4.000 1st Qu.:5.000 1st Qu.:4.000 1st Qu.:3.000
## Median :5.000 Median :6.000 Median :5.000 Median :5.000
## Mean :4.857 Mean :5.247 Mean :5.161 Mean :4.371
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :7.000 Max. :7.000 Max. :7.000 Max. :7.000
##
## WOM_1 WOM_2 Futu_Pur_1 Futu_Pur_2
## Min. :2.000 Min. :1.000 Min. :1.000 Min. :2.000
## 1st Qu.:5.000 1st Qu.:5.000 1st Qu.:4.000 1st Qu.:4.000
## Median :6.000 Median :6.000 Median :6.000 Median :6.000
## Mean :5.631 Mean :5.678 Mean :5.307 Mean :5.337
## 3rd Qu.:7.000 3rd Qu.:7.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :7.000 Max. :7.000 Max. :9.000 Max. :7.000
##
## Valu_Percp_1 Valu_Percp_2 Pur_Proces_1 Pur_Proces_2
## Min. :2.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:5.000 1st Qu.:4.000 1st Qu.:4.000 1st Qu.:3.000
## Median :6.000 Median :5.000 Median :5.000 Median :5.000
## Mean :5.449 Mean :4.918 Mean :5.132 Mean :4.592
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :7.000 Max. :7.000 Max. :7.000 Max. :7.000
##
## Residence Pay_Meth Insur_Type Gender
## Min. :1.000 Min. :1.000 Length:292 Length:292
## 1st Qu.:1.000 1st Qu.:1.000 Class :character Class :character
## Median :1.000 Median :2.000 Mode :character Mode :character
## Mean :1.431 Mean :2.158
## 3rd Qu.:2.000 3rd Qu.:3.000
## Max. :2.000 Max. :3.000
## NA's :4
## Age Education Region Model
## Min. :18.00 Min. :1.000 Length:292 Length:292
## 1st Qu.:26.00 1st Qu.:2.000 Class :character Class :character
## Median :34.00 Median :2.000 Mode :character Mode :character
## Mean :35.11 Mean :2.017
## 3rd Qu.:42.75 3rd Qu.:2.000
## Max. :60.00 Max. :3.000
##
## MPG Cyl acc1 C_cost.
## Min. :20.00 Min. :4.000 Min. :7.200 Min. : 7.000
## 1st Qu.:20.00 1st Qu.:4.000 1st Qu.:7.200 1st Qu.: 7.000
## Median :24.00 Median :4.000 Median :8.000 Median :10.000
## Mean :22.74 Mean :4.945 Mean :7.668 Mean : 9.055
## 3rd Qu.:26.00 3rd Qu.:6.000 3rd Qu.:8.000 3rd Qu.:10.000
## Max. :26.00 Max. :6.000 Max. :8.200 Max. :10.000
##
## H_Cost Post.Satis Make Model_v1
## Min. :6.000 Min. :3.000 Length:292 Length:292
## 1st Qu.:6.000 1st Qu.:5.000 Class :character Class :character
## Median :8.000 Median :6.000 Mode :character Mode :character
## Mean :7.604 Mean :5.545
## 3rd Qu.:8.500 3rd Qu.:6.000
## Max. :8.500 Max. :7.000
##
## Att_Mean Enj_Mean Perform_Mean WOM_Mean Futu_Pur_Mean
## Min. :1.000 Min. :1.00 Min. :1.333 Min. :2.000 Min. :2.000
## 1st Qu.:4.000 1st Qu.:4.50 1st Qu.:4.333 1st Qu.:5.000 1st Qu.:4.500
## Median :5.500 Median :5.50 Median :5.000 Median :6.000 Median :6.000
## Mean :5.255 Mean :5.22 Mean :4.926 Mean :5.655 Mean :5.322
## 3rd Qu.:6.500 3rd Qu.:6.50 3rd Qu.:6.000 3rd Qu.:7.000 3rd Qu.:6.000
## Max. :7.000 Max. :7.00 Max. :7.000 Max. :7.000 Max. :7.000
##
## Valu_Percp_Mean Pur_Proces_Mean AttGrp EnjGrp PerformGrp
## Min. :2.000 Min. :1.500 [6,7) :87 [6,7) :87 [5,6) :90
## 1st Qu.:4.500 1st Qu.:4.000 [4,5) :82 [5,6) :80 [4,5) :79
## Median :5.500 Median :5.000 [7,Inf):47 [4,5) :45 [6,7) :60
## Mean :5.184 Mean :4.862 [5,6) :43 [7,Inf):34 [3,4) :30
## 3rd Qu.:6.000 3rd Qu.:6.000 [3,4) :20 [3,4) :29 [7,Inf):15
## Max. :7.000 Max. :7.000 [2,3) :10 [2,3) : 9 [2,3) :14
## (Other): 3 (Other): 8 (Other): 4
## WOMGrp FutuGrp ValuGrp PurGrp AgeGrp
## [6,7) :94 [6,7) :119 [5,6) :112 [5,6) :81 [18,30) :104
## [7,Inf):75 [5,6) : 59 [6,7) : 86 [6,7) :74 [30,42) :108
## [5,6) :55 [4,5) : 50 [4,5) : 62 [4,5) :71 [42,54) : 57
## [4,5) :43 [7,Inf): 28 [2,3) : 12 [3,4) :38 [54,Inf): 23
## [3,4) :21 [3,4) : 27 [3,4) : 11 [2,3) :16
## [2,3) : 4 [2,3) : 9 [7,Inf): 9 [7,Inf):10
## (Other): 0 (Other): 0 (Other): 0 (Other): 2
summary(Toyota[Toyota$Region == "American", "Att_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.000 4.500 6.000 5.422 6.500 7.000
summary(Toyota[Toyota$Region == "Asian", "Att_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.500 4.000 5.500 5.058 6.500 7.000
summary(Toyota[Toyota$Region == "European", "Att_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.500 4.000 5.000 5.269 6.500 7.000
summary(Toyota[Toyota$Region == "Middle Eastern", "Att_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.000 4.500 5.250 5.500 6.625 7.000
ggplot(Toyota,aes(x=AttGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")
## Warning: The dot-dot notation (`..count..`) was deprecated in ggplot2 3.4.0.
## ℹ Please use `after_stat(count)` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
labs(y="Number of Different Level Agree of Attitude",
title = "Number of Different Level Agree of Attitude by Region")
## $y
## [1] "Number of Different Level Agree of Attitude"
##
## $title
## [1] "Number of Different Level Agree of Attitude by Region"
##
## attr(,"class")
## [1] "labels"
summary(Toyota[Toyota$Region == "American", "Enj_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.500 5.500 5.269 6.500 7.000
summary(Toyota[Toyota$Region == "Asian", "Enj_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.000 4.000 5.500 4.951 6.500 7.000
summary(Toyota[Toyota$Region == "European", "Enj_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 5.000 5.500 5.541 6.500 7.000
summary(Toyota[Toyota$Region == "Middle Eastern", "Enj_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.500 3.875 4.500 4.812 5.750 6.500
ggplot(Toyota,aes(x=EnjGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")
labs(y="Number of Different Level Agree of Enjoyment",
title = "Number of Different Level Agree of Enjoyment by Region")
## $y
## [1] "Number of Different Level Agree of Enjoyment"
##
## $title
## [1] "Number of Different Level Agree of Enjoyment by Region"
##
## attr(,"class")
## [1] "labels"
summary(Toyota[Toyota$Region == "American", "Perform_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.333 4.000 5.000 4.798 5.667 7.000
summary(Toyota[Toyota$Region == "Asian", "Perform_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.333 4.333 5.000 4.859 6.000 7.000
summary(Toyota[Toyota$Region == "European", "Perform_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 4.667 5.000 5.208 6.000 7.000
summary(Toyota[Toyota$Region == "Middle Eastern", "Perform_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.667 3.833 4.500 4.583 5.000 7.000
ggplot(Toyota,aes(x=PerformGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Different Level Agree of Performance",
title = "Number of Different Level Agree of Performance by Region")
summary(Toyota[Toyota$Region == "American", "WOM_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 5.000 6.000 5.683 6.500 7.000
summary(Toyota[Toyota$Region == "Asian", "WOM_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 4.500 5.500 5.564 6.500 7.000
summary(Toyota[Toyota$Region == "European", "WOM_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.500 5.000 6.000 5.763 7.000 7.000
summary(Toyota[Toyota$Region == "Middle Eastern", "WOM_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.500 5.000 6.000 5.375 6.000 6.500
ggplot(Toyota,aes(x=WOMGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Different Level Agree of Word-of-Mouth",
title = "Number of Different Level Agree of Word-of-Mouth by Region")
summary(Toyota[Toyota$Region == "American", "Futu_Pur_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.500 6.000 5.314 6.000 7.000
summary(Toyota[Toyota$Region == "Asian", "Futu_Pur_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 4.500 5.500 5.382 6.500 7.000
summary(Toyota[Toyota$Region == "European", "Futu_Pur_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.500 5.500 5.275 6.000 7.000
summary(Toyota[Toyota$Region == "Middle Eastern", "Futu_Pur_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 3.875 5.500 5.125 6.125 7.000
ggplot(Toyota,aes(x=FutuGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Different Level Agree of Future Purchase Intention",
title = "Number of Different Level Agree of Future Purchase Intention by Region")
summary(Toyota[Toyota$Region == "American", "Valu_Percp_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.500 4.500 5.000 5.119 6.000 7.000
summary(Toyota[Toyota$Region == "Asian", "Valu_Percp_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.500 5.500 5.127 6.000 7.000
summary(Toyota[Toyota$Region == "European", "Valu_Percp_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.500 5.000 5.500 5.281 6.000 7.000
summary(Toyota[Toyota$Region == "Middle Eastern", "Valu_Percp_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.500 4.500 6.000 5.750 6.625 7.000
ggplot(Toyota,aes(x=ValuGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Different Level Agree of Value Perception",
title = "Number of Different Level Agree of Value Perception by Region")
summary(Toyota[Toyota$Region == "American", "Pur_Proces_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.50 4.00 5.00 4.77 5.50 7.00
summary(Toyota[Toyota$Region == "Asian", "Pur_Proces_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.500 5.500 5.079 6.000 7.000
summary(Toyota[Toyota$Region == "European", "Pur_Proces_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.000 4.500 4.625 5.500 6.500
summary(Toyota[Toyota$Region == "Middle Eastern", "Pur_Proces_Mean"])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 4.875 6.250 5.625 7.000 7.000
ggplot(Toyota,aes(x=PurGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Different Level Agree of Purchase Process",
title = "Number of Different Level Agree of Purchase Process by Region")
#Graphic
ggplot(Toyota,aes(x=AgeGrp,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Different Level of Age",
title = "Number of Different Level of Age by Region")
ggplot(Toyota,aes(x=Gender,fill=Gender)) +
theme_bw()+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Gender",
title = "Number of Gender by Region")
ggplot(Toyota,aes(x=Education,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Education",
title = "Number of Education by Region")
ggplot(Toyota,aes(x=Model,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Model",
title = "Number of Model by Region")
ggplot(Toyota,aes(x=Pay_Meth,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Pay Method",
title = "Number of Different Pay Method by Region")
ggplot(Car_Total,aes(x=Region, fill = Region))+
theme_bw()+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue") +
labs(y="Number of Cars",
x = "Region",
title = "Number of Cars by Region")
ggplot(Car_Total,aes(x=Make,fill=Region)) +
theme_bw()+
facet_wrap(~Region)+
geom_bar()+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Model",
title = "Number of Model by Region")
ggplot(Car_Total,aes(x=MPG,fill=Model)) +
theme_bw()+
facet_wrap(~Make)+
geom_bar()+scale_x_continuous(breaks = 15:26)+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of MPG",
title = "Number of MPG by Make")
ggplot(Car_Total,aes(x=Cyl,fill=Model)) +
theme_bw()+
facet_wrap(~Make)+
geom_bar()+scale_x_continuous(breaks = 3:10)+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Cylinder",
title = "Number of Cylinder by Make")
ggplot(Car_Total,aes(x=acc1,fill=Model)) +
theme_bw()+
facet_wrap(~Make)+
geom_bar()+scale_x_continuous(breaks = 5:10)+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Acceleration",
title = "Number of Acceleration by Make")
ggplot(Car_Total,aes(x=C_cost.,fill=Model)) +
theme_bw()+
facet_wrap(~Make)+
geom_bar()+scale_x_continuous(breaks = 7:17)+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of City Cost",
title = "Number of City Cost by Model")
ggplot(Car_Total,aes(x=H_Cost,fill=Model)) +
theme_bw()+
facet_wrap(~Make)+
geom_bar()+scale_x_continuous(breaks = 6:20)+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Highway Cost",
title = "Number of Highway Cost by Model")
ggplot(Car_Total,aes(x=Post.Satis,fill=Make)) +
theme_bw()+
facet_wrap(~Make)+
geom_bar()+scale_x_continuous(breaks = 1:10)+
geom_text(stat="count", aes(label=..count..), vjust=0, size=5, color="blue")+
labs(y="Number of Post Purcahse Satisfaction",
title = "Number of Post Purchase Satisfaction by Make")