Anly 500 Lab

subject Type Homework Help
subject Pages 9
subject Words 1897
subject School N/A
subject Course N/A

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
ANLY 500 Laboratory #1 Part 3
> Customersurvey2014 <- read.csv("C:/Users/zhoush2/Downloads/Customersurvey20
14.csv")
> tdealerSat_NA
Error: object 'tdealerSat_NA' not found
> Dealersatisfaction <- read.csv("C:/Users/zhoush2/Downloads/Dealersatisfacti
on.csv")
> tdealerSat_NA
Error: object 'tdealerSat_NA' not found
> View(Dealersatisfaction)
> tdealerSat_NA
Error: object 'tdealerSat_NA' not found
> str(DealerSatisfaction)
Error in str(DealerSatisfaction) : object 'DealerSatisfaction' not found
>
> str(Dealersatisfaction)
'data.frame': 23 obs. of 9 variables:
$ Location: Factor w/ 4 levels "CH","EU","PA",..: NA NA NA NA NA 4 4 4 4 4
...
$ Year : int 2010 2011 2012 2013 2014 2010 2011 2012 2013 2014 ...
$ X0 : int 1 0 1 1 2 0 0 0 0 1 ...
$ X1 : int 0 0 1 2 3 0 0 0 1 1 ...
$ X2 : int 2 2 1 6 5 0 0 1 1 2 ...
$ X3 : int 14 14 8 12 15 2 2 4 3 4 ...
$ X4 : int 22 20 34 34 44 6 6 11 12 22 ...
$ X5 : int 11 14 15 45 56 2 2 14 33 60 ...
$ Size : int 50 50 60 100 125 10 10 30 50 90 ...
>
> tDealersat_NA
Error: object 'tDealersat_NA' not found
> str(EndUsersatisfaction)
Error in str(EndUsersatisfaction) :
object 'EndUsersatisfaction' not found
>
> dealerSat_NA <- Dealersatisfaction[1:5, ]
> dealerSat_NA
Location Year X0 X1 X2 X3 X4 X5 Size
1 <NA> 2010 1 0 2 14 22 11 50
2 <NA> 2011 0 0 2 14 20 14 50
3 <NA> 2012 1 1 1 8 34 15 60
4 <NA> 2013 1 2 6 12 34 45 100
5 <NA> 2014 2 3 5 15 44 56 125
> tdealerSat_NA <- t(dealerSat_NA[,3:8])
> tdealerSat_NA
1 2 3 4 5
X0 1 0 1 1 2
X1 0 0 1 2 3
X2 2 2 1 6 5
X3 14 14 8 12 15
X4 22 20 34 34 44
X5 11 14 15 45 56
>
> colnames(tdealerSat_NA) <- c("2010", "2011", "2012", "2013", "2014")
> tdealerSat_NA
2010 2011 2012 2013 2014
X0 1 0 1 1 2
X1 0 0 1 2 3
X2 2 2 1 6 5
X3 14 14 8 12 15
X4 22 20 34 34 44
X5 11 14 15 45 56
> m_NA2010 <- ((tdealerSat_NA[2,1]*1) + (tdealerSat_NA[3,1]*2) + (tdealerSat_
NA[4,1]*3) + (tdealerSat_NA[
+ 5,1]*4) + (tdealerSat_NA[6,1]*5))/sum(tdealerSat_NA[,1])
> m_NA2010
[1] 3.78
> Dealersatisfaction[Dealersatisfaction == "NA"] <- "NorthA"
> n <- matrix(m, 5, byrow=FALSE)
Error in matrix(m, 5, byrow = FALSE) : object 'm' not found
> custSurveyNA <- Customersurvey2014[1:100,-1]
> custSurveySA <-Customersurvey2014[102:151,-1]
> describe(custSurveySA)
Error in describe(custSurveySA) : could not find function "describe"
>
> install.packages("Describe")
Warning in install.packages :
package ‘Describe’ is not available (for R version 3.4.0)
Warning in install.packages :
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.4
/PACKAGES.rds': HTTP status was '404 Not Found'
> install.packages("psych")
also installing the dependency ‘mnormt’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/mnormt_1.5-5.zip
'
Content type 'application/zip' length 102288 bytes (99 KB)
downloaded 99 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/psych_1.7.5.zip'
Content type 'application/zip' length 3965669 bytes (3.8 MB)
downloaded 3.8 MB
package ‘mnormt’ successfully unpacked and MD5 sums checked
package ‘psych’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\zhoush2\AppData\Local\Temp\Rtmp8s1Hr7\downloaded_packages
> library("psych", lib.loc="~/R/R-3.4.0/library")
> describe(custSurveySA)
vars n mean sd median trimmed mad min max range skew kurtosi
s se
Quality 1 50 4.26 0.78 4 4.38 0.74 1 5 4 -1.49 4.0
7 0.11
Ease.of.Use 2 50 3.94 0.74 4 4.00 0.00 1 5 4 -1.39 3.9
2 0.10
Price 3 50 3.54 1.07 4 3.60 1.48 1 5 4 -0.59 -0.4
9 0.15
Service 4 50 4.20 0.83 4 4.30 1.48 1 5 4 -1.20 2.3
0 0.12
> install.packages("pastecs")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/pastecs_1.3-18.z
ip'
Content type 'application/zip' length 1636690 bytes (1.6 MB)
downloaded 1.6 MB
package ‘pastecs’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\zhoush2\AppData\Local\Temp\Rtmp8s1Hr7\downloaded_packages
> library("pastecs", lib.loc="~/R/R-3.4.0/library")
Loading required package: boot
Attaching package: ‘boot’
The following object is masked from ‘package:psych’:
logit
> stat.desc(custSurveySA)
Quality Ease.of.Use Price Service
nbr.val 50.0000000 50.0000000 50.0000000 50.0000000
nbr.null 0.0000000 0.0000000 0.0000000 0.0000000
nbr.na 0.0000000 0.0000000 0.0000000 0.0000000
min 1.0000000 1.0000000 1.0000000 1.0000000
max 5.0000000 5.0000000 5.0000000 5.0000000
range 4.0000000 4.0000000 4.0000000 4.0000000
sum 213.0000000 197.0000000 177.0000000 210.0000000
median 4.0000000 4.0000000 4.0000000 4.0000000
mean 4.2600000 3.9400000 3.5400000 4.2000000
SE.mean 0.1099536 0.1046276 0.1517517 0.1178030
CI.mean.0.95 0.2209600 0.2102571 0.3049564 0.2367340
var 0.6044898 0.5473469 1.1514286 0.6938776
std.dev 0.7774894 0.7398290 1.0730464 0.8329931
coef.var 0.1825093 0.1877739 0.3031205 0.1983317
> str(Respondtime)
'data.frame': 50 obs. of 8 variables:
$ Q1.2013: num 4.36 5.42 5.5 2.79 5.55 3.65 8.02 4 3.34 4.92 ...
$ Q2.2013: num 4.33 4.73 1.63 4.21 6.89 0.92 5.27 0.9 3.85 5 ...
$ Q3.2013: num 3.71 2.52 2.69 3.47 5.12 1 3.44 6.04 2.53 2.39 ...
$ Q4.2013: num 4.44 4.07 5.11 3.49 4.69 6.36 8.26 1.91 8.93 6.85 ...
$ Q1.2014: num 2.75 3.24 4.35 5.58 2.89 5.09 2.33 1.69 3.88 3.39 ...
$ Q2.2014: num 3.45 1.95 2.77 1.83 3.72 4.59 1.17 1.46 1.9 2.95 ...
$ Q3.2014: num 1.67 2.58 3.47 3.12 1 5.4 3.9 4.49 2.06 4.49 ...
$ Q4.2014: num 2.55 2.3 1.04 1.59 3.11 4.05 3.38 1.26 0.9 2.31 ...
> mRespondtime <- c(mean(Respondtime$Q1.2013), mean(Respondtime$Q2.2013), mea
n(Respondtime$Q
+
3.2013), mean(Respondtime$Q4.2013), mean(Respondtime$Q1.2014), mean(Resp
ondtime$Q2.2014), mean(
Error: unexpected numeric constant in:
"mRespondtime <- c(mean(Respondtime$Q1.2013), mean(Respondtime$Q2.2013), mean
(Respondtime$Q
3.2013"
>
Respondtime$Q3.2014), mean(Respondtime$Q4.2014))
page-pf4
Error: unexpected ')' in "
Respondtime$Q3.2014)"
> > mRespondtime
Error: unexpected '>' in ">"
> mRespondtime <- c(mean(Respondtime$Q1.2013), mean(ResponseTime$Q2.2013), me
an(Respondtime$Q3.2013), mean(Respondtime$Q4.2013), mean(Respondtime$Q1.201
4), mean(Respondtime$Q2.2014), mean(Respondtime$Q3.2014), mean(Respondtime$Q
4.2014))
Error in mean(ResponseTime$Q2.2013) : object 'ResponseTime' not found
> > mRespondtime
Error: unexpected '>' in ">"
> mRespondtime <- c(mean(Respondtime$Q1.2013), mean(Respondtime$Q2.2013), mea
n(Respondtime$Q3.2013), mean(Respondtime$Q4.2013), mean(Respondtime$Q1.2014),
mean(Respondtime$Q2.2014), mean(Respondtime$Q3.2014), mean(Respondtime$Q4.20
14))
> mRespondtime
page-pf5
page-pf6
page-pf7
page-pf8
page-pf9
page-pfa
page-pfb
page-pfc

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.