library(LearnEDAfunctions)
## Loading required package: dplyr
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Loading required package: ggplot2
LearnEDAfunctions::lake
## Area Depth PH Wshed Hions
## 1 55 19 7.1 0.8 1.0e-07
## 2 26 14 6.1 0.3 8.0e-07
## 3 1065 36 7.6 6.3 0.0e+00
## 4 213 71 7.6 4.0 0.0e+00
## 5 1463 35 8.2 33.0 0.0e+00
## 6 180 24 7.1 5.0 1.0e-07
## 7 433 56 6.8 2.5 2.0e-07
## 8 437 30 7.4 2.0 0.0e+00
## 9 207 34 7.4 1.7 0.0e+00
## 10 98 17 7.0 1.5 1.0e-07
## 11 33 32 6.6 0.2 3.0e-07
## 12 30 10 6.2 1.0 6.0e-07
## 13 176 17 7.3 1.0 1.0e-07
## 14 55 43 6.0 0.5 1.0e-06
## 15 96 14 7.8 1.0 0.0e+00
## 16 23 18 6.5 0.3 3.0e-07
## 17 282 24 7.4 2.0 0.0e+00
## 18 124 17 7.0 1.5 1.0e-07
## 19 22 14 6.9 0.2 1.0e-07
## 20 223 17 5.7 1.5 2.0e-06
## 21 107 26 6.8 0.8 2.0e-07
## 22 112 33 7.2 1.2 1.0e-07
## 23 161 25 6.4 1.0 4.0e-07
## 24 301 24 8.6 88.0 0.0e+00
## 25 59 7 7.3 2.0 1.0e-07
## 26 88 13 6.0 0.7 1.0e-06
## 27 97 50 8.6 2.0 0.0e+00
## 28 126 37 6.9 1.0 1.0e-07
## 29 356 17 7.0 2.0 1.0e-07
## 30 148 50 6.8 0.8 2.0e-07
## 31 397 26 6.9 2.0 1.0e-07
## 32 89 9 5.8 1.0 1.6e-06
## 33 237 9 6.6 13.0 3.0e-07
## 34 29 33 6.2 0.2 6.0e-07
## 35 238 19 6.1 1.8 8.0e-07
## 36 189 15 6.5 2.5 3.0e-07
## 37 599 43 8.6 3.0 0.0e+00
## 38 149 11 6.9 65.0 1.0e-07
## 39 34 15 5.8 2.0 1.6e-06
## 40 533 32 7.8 12.0 0.0e+00
## 41 47 65 7.1 0.3 1.0e-07
## 42 170 11 7.5 6.4 0.0e+00
## 43 113 58 7.0 1.0 1.0e-07
## 44 352 16 8.8 8.0 0.0e+00
## 45 187 36 6.4 4.0 4.0e-07
## 46 48 13 6.2 0.8 6.0e-07
## 47 76 9 5.9 0.7 1.3e-06
## 48 52 7 6.7 0.4 2.0e-07
## 49 175 25 7.1 0.9 1.0e-07
## 50 191 45 6.7 3.0 2.0e-07
## 51 1285 60 6.4 80.0 4.0e-07
## 52 124 40 7.5 0.7 0.0e+00
## 53 53 23 6.6 0.7 3.0e-07
## 54 125 89 6.8 1.0 2.0e-07
## 55 3585 39 7.4 10.0 0.0e+00
## 56 211 55 7.2 0.5 1.0e-07
## 57 372 28 7.3 1.4 1.0e-07
## 58 33 21 6.0 1.0 1.0e-06
## 59 172 33 7.2 2.0 1.0e-07
## 60 716 42 7.0 8.0 1.0e-07
## 61 130 7 7.2 2.0 1.0e-07
## 62 610 39 7.0 3.0 1.0e-07
## 63 223 70 7.0 1.5 1.0e-07
## 64 1352 45 6.9 17.0 1.0e-07
## 65 35 14 6.2 0.4 6.0e-07
## 66 132 27 7.0 1.0 1.0e-07
## 67 95 33 6.1 0.9 8.0e-07
## 68 77 23 7.6 0.6 0.0e+00
## 69 185 31 7.1 12.0 1.0e-07
## 70 97 71 6.8 1.0 2.0e-07
## 71 28 38 7.1 0.4 1.0e-07
head(lake)
## Area Depth PH Wshed Hions
## 1 55 19 7.1 0.8 1e-07
## 2 26 14 6.1 0.3 8e-07
## 3 1065 36 7.6 6.3 0e+00
## 4 213 71 7.6 4.0 0e+00
## 5 1463 35 8.2 33.0 0e+00
## 6 180 24 7.1 5.0 1e-07
hist(lake$Depth)
lines(density(lake$Depth, bw=1.5), lwd=2)
plot(density(lake$Depth, bw=1.5), lwd=2,
axes=FALSE,
xlab="" ,
ylab="",
main="")
box()
par(mfrow=c(2,2))
hist(lake$Depth, main="Raw+")
hist(sqrt(lake$Depth+.05),main="ROOTS")
hist((lake$Depth+.05)^0.001, main="p=0.001")
aplpack::stem.leaf(lake$Depth)
## 1 | 2: represents 12
## leaf unit: 1
## n: 71
## 6 0. | 777999
## 15 1* | 011334444
## 26 1. | 55677777899
## 32 2* | 133444
## (6) 2. | 556678
## 33 3* | 012233334
## 24 3. | 5667899
## 17 4* | 0233
## 13 4. | 55
## 11 5* | 00
## 9 5. | 568
## 6 6* | 0
## 5 6. | 5
## 4 7* | 011
## HI: 89
(letter.values<-lval(lake$Area))
## depth lo hi mids spreads
## M 36.0 148.0 148.0 148.00 0.0
## H 18.5 76.5 237.5 157.00 161.0
## E 9.5 34.5 485.0 259.75 450.5
## D 5.0 29.0 1065.0 547.00 1036.0
## C 3.0 26.0 1352.0 689.00 1326.0
## B 2.0 23.0 1463.0 743.00 1440.0
## A 1.0 22.0 3585.0 1803.50 3563.0
select(letter.values, mids)
## mids
## M 148.00
## H 157.00
## E 259.75
## D 547.00
## C 689.00
## B 743.00
## A 1803.50
letter.values%>% mutate(LV=1:7)%>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Raw Data")
roots<-sqrt(lake$Depth)
aplpack::stem.leaf(roots)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 71
## 3 2. | 666
## 9 3* | 000133
## 17 3. | 66777788
## 26 4* | 011111233
## 32 4. | 577888
## (7) 5* | 0000124
## 32 5. | 566777789
## 23 6* | 00012234
## 15 6. | 5577
## 11 7* | 0044
## 7 7. | 67
## 5 8* | 0344
## 8. |
## 1 9* | 4
(root.lv <- (roots))
## [1] 4.358899 3.741657 6.000000 8.426150 5.916080 4.898979 7.483315 5.477226
## [9] 5.830952 4.123106 5.656854 3.162278 4.123106 6.557439 3.741657 4.242641
## [17] 4.898979 4.123106 3.741657 4.123106 5.099020 5.744563 5.000000 4.898979
## [25] 2.645751 3.605551 7.071068 6.082763 4.123106 7.071068 5.099020 3.000000
## [33] 3.000000 5.744563 4.358899 3.872983 6.557439 3.316625 3.872983 5.656854
## [41] 8.062258 3.316625 7.615773 4.000000 6.000000 3.605551 3.000000 2.645751
## [49] 5.000000 6.708204 7.745967 6.324555 4.795832 9.433981 6.244998 7.416198
## [57] 5.291503 4.582576 5.744563 6.480741 2.645751 6.244998 8.366600 6.708204
## [65] 3.741657 5.196152 5.744563 4.795832 5.567764 8.426150 6.164414
roots <- sqrt(lake$Depth)
root.lv <- lval(roots)
root.lv %>%
mutate(LV = 1:7) %>%
ggplot(aes(LV, mids)) +
geom_point() +
ggtitle("Root Data")
logs<-log(lake$Depth)
aplpack::stem.leaf(logs)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 71
## 3 1. | 999
## 6 2* | 111
## 9 t | 333
## 11 f | 55
## 18 s | 6666777
## 26 2. | 88888899
## 32 3* | 011111
## (6) t | 222223
## 33 f | 444444445555
## 21 s | 66666777
## 13 3. | 8899
## 9 4* | 00001
## 4 t | 222
## 1 f | 4
(logs.lv<-lval(logs))
## depth lo hi mids spreads
## M 36.0 3.258097 3.258097 3.258097 0.0000000
## H 18.5 2.802901 3.663562 3.233231 0.8606606
## E 9.5 2.481422 3.959678 3.220550 1.4782558
## D 5.0 2.197225 4.174387 3.185806 1.9771627
## C 3.0 1.945910 4.262680 3.104295 2.3167697
## B 2.0 1.945910 4.262680 3.104295 2.3167697
## A 1.0 1.945910 4.488636 3.217273 2.5427262
logs.lv %>% mutate(LV=1:7) %>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Log Data")
This data set shows a right-skewed distribution. After applying both
square root and logarithmic transformations, the shape becomes more
symmetric, as seen in the histograms and letter-value plots. The log
transformation produces the most balanced distribution.
library(LearnEDAfunctions)
LearnEDAfunctions::lake
## Area Depth PH Wshed Hions
## 1 55 19 7.1 0.8 1.0e-07
## 2 26 14 6.1 0.3 8.0e-07
## 3 1065 36 7.6 6.3 0.0e+00
## 4 213 71 7.6 4.0 0.0e+00
## 5 1463 35 8.2 33.0 0.0e+00
## 6 180 24 7.1 5.0 1.0e-07
## 7 433 56 6.8 2.5 2.0e-07
## 8 437 30 7.4 2.0 0.0e+00
## 9 207 34 7.4 1.7 0.0e+00
## 10 98 17 7.0 1.5 1.0e-07
## 11 33 32 6.6 0.2 3.0e-07
## 12 30 10 6.2 1.0 6.0e-07
## 13 176 17 7.3 1.0 1.0e-07
## 14 55 43 6.0 0.5 1.0e-06
## 15 96 14 7.8 1.0 0.0e+00
## 16 23 18 6.5 0.3 3.0e-07
## 17 282 24 7.4 2.0 0.0e+00
## 18 124 17 7.0 1.5 1.0e-07
## 19 22 14 6.9 0.2 1.0e-07
## 20 223 17 5.7 1.5 2.0e-06
## 21 107 26 6.8 0.8 2.0e-07
## 22 112 33 7.2 1.2 1.0e-07
## 23 161 25 6.4 1.0 4.0e-07
## 24 301 24 8.6 88.0 0.0e+00
## 25 59 7 7.3 2.0 1.0e-07
## 26 88 13 6.0 0.7 1.0e-06
## 27 97 50 8.6 2.0 0.0e+00
## 28 126 37 6.9 1.0 1.0e-07
## 29 356 17 7.0 2.0 1.0e-07
## 30 148 50 6.8 0.8 2.0e-07
## 31 397 26 6.9 2.0 1.0e-07
## 32 89 9 5.8 1.0 1.6e-06
## 33 237 9 6.6 13.0 3.0e-07
## 34 29 33 6.2 0.2 6.0e-07
## 35 238 19 6.1 1.8 8.0e-07
## 36 189 15 6.5 2.5 3.0e-07
## 37 599 43 8.6 3.0 0.0e+00
## 38 149 11 6.9 65.0 1.0e-07
## 39 34 15 5.8 2.0 1.6e-06
## 40 533 32 7.8 12.0 0.0e+00
## 41 47 65 7.1 0.3 1.0e-07
## 42 170 11 7.5 6.4 0.0e+00
## 43 113 58 7.0 1.0 1.0e-07
## 44 352 16 8.8 8.0 0.0e+00
## 45 187 36 6.4 4.0 4.0e-07
## 46 48 13 6.2 0.8 6.0e-07
## 47 76 9 5.9 0.7 1.3e-06
## 48 52 7 6.7 0.4 2.0e-07
## 49 175 25 7.1 0.9 1.0e-07
## 50 191 45 6.7 3.0 2.0e-07
## 51 1285 60 6.4 80.0 4.0e-07
## 52 124 40 7.5 0.7 0.0e+00
## 53 53 23 6.6 0.7 3.0e-07
## 54 125 89 6.8 1.0 2.0e-07
## 55 3585 39 7.4 10.0 0.0e+00
## 56 211 55 7.2 0.5 1.0e-07
## 57 372 28 7.3 1.4 1.0e-07
## 58 33 21 6.0 1.0 1.0e-06
## 59 172 33 7.2 2.0 1.0e-07
## 60 716 42 7.0 8.0 1.0e-07
## 61 130 7 7.2 2.0 1.0e-07
## 62 610 39 7.0 3.0 1.0e-07
## 63 223 70 7.0 1.5 1.0e-07
## 64 1352 45 6.9 17.0 1.0e-07
## 65 35 14 6.2 0.4 6.0e-07
## 66 132 27 7.0 1.0 1.0e-07
## 67 95 33 6.1 0.9 8.0e-07
## 68 77 23 7.6 0.6 0.0e+00
## 69 185 31 7.1 12.0 1.0e-07
## 70 97 71 6.8 1.0 2.0e-07
## 71 28 38 7.1 0.4 1.0e-07
head(lake)
## Area Depth PH Wshed Hions
## 1 55 19 7.1 0.8 1e-07
## 2 26 14 6.1 0.3 8e-07
## 3 1065 36 7.6 6.3 0e+00
## 4 213 71 7.6 4.0 0e+00
## 5 1463 35 8.2 33.0 0e+00
## 6 180 24 7.1 5.0 1e-07
hist(lake$Area)
par(mfrow=c(2,2))
hist(lake$Area, main="Raw+")
hist(sqrt(lake$Area+.05),main="ROOTS")
hist((lake$Area+.05)^0.001, main="p=0.001")
aplpack::stem.leaf(lake$Area)
## 1 | 2: represents 120
## leaf unit: 10
## n: 71
## 12 0* | 222223333344
## 26 0. | 55555778899999
## (11) 1* | 01122223344
## 34 1. | 6777788889
## 24 2* | 0112233
## 17 2. | 8
## 16 3* | 0
## 15 3. | 5579
## 11 4* | 33
## 4. |
## 9 5* | 3
## HI: 599 610 716 1065 1285 1352 1463 3585
(letter.values <-lval(lake$Area))
## depth lo hi mids spreads
## M 36.0 148.0 148.0 148.00 0.0
## H 18.5 76.5 237.5 157.00 161.0
## E 9.5 34.5 485.0 259.75 450.5
## D 5.0 29.0 1065.0 547.00 1036.0
## C 3.0 26.0 1352.0 689.00 1326.0
## B 2.0 23.0 1463.0 743.00 1440.0
## A 1.0 22.0 3585.0 1803.50 3563.0
select(letter.values, mids)
## mids
## M 148.00
## H 157.00
## E 259.75
## D 547.00
## C 689.00
## B 743.00
## A 1803.50
letter.values %>% mutate(LV=1:7) %>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Raw Data")
roots <-sqrt(lake$Area)
aplpack::stem.leaf(roots)
## 1 | 2: represents 12
## leaf unit: 1
## n: 71
## 10 f | 4455555555
## 17 s | 6677777
## 26 0. | 889999999
## 35 1* | 000111111
## (12) t | 222333333333
## 24 f | 4444455
## 17 s | 67
## 15 1. | 8899
## 11 2* | 00
## 9 t | 3
## 8 f | 44
## 6 s | 6
## HI: 32.6343377441614 35.8468966578698 36.7695526217005 38.2491829978106 59.8748695196908
(root.lv <-lval(roots))
## depth lo hi mids spreads
## M 36.0 12.165525 12.16553 12.16553 0.000000
## H 18.5 8.746381 15.41103 12.07870 6.664645
## E 9.5 5.873516 21.99567 13.93459 16.122153
## D 5.0 5.385165 32.63434 19.00975 27.249173
## C 3.0 5.099020 36.76955 20.93429 31.670533
## B 2.0 4.795832 38.24918 21.52251 33.453351
## A 1.0 4.690416 59.87487 32.28264 55.184454
root.lv %>% mutate(LV= 1:7)%>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Root Data")
logs <-log(lake$Area)
aplpack::stem.leaf(logs)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 71
## 8 3* | 01233444
## 14 3. | 558899
## 21 4* | 0003344
## (15) 4. | 555556778888889
## 35 5* | 001111122223334444
## 17 5. | 678899
## 11 6* | 00234
## 6 6. | 59
## 4 7* | 122
## 7. |
## 1 8* | 1
root.lv %>% mutate(LV= 1:7)%>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Log Data")
recroots <- -1/sqrt(lake$Area)
aplpack::stem.leaf(recroots)
## 1 | 2: represents 0.012
## leaf unit: 0.001
## n: 71
## LO: -0.21320071635561 -0.208514414057075
## 3 -19 | 6
## 6 -18 | 852
## 9 -17 | 441
## 10 -16 | 9
## -15 |
## 12 -14 | 54
## 17 -13 | 87440
## -12 |
## 19 -11 | 43
## 26 -10 | 6522111
## 29 -9 | 644
## (8) -8 | 99997721
## 34 -7 | 8665543322
## 24 -6 | 9886644
## 17 -5 | 973210
## 11 -4 | 87300
## 6 -3 | 70
## 4 -2 | 776
## 1 -1 | 6
This data set shows a right-skewed distribution. After applying both square root,logarithmic, and log transformations, the shape becomes more symmetric, as seen in the histograms and letter-value plots. The recipricol roots transformation produces the most balanced distribution.
CFB <- read.csv("C:/Users/KayVog22/Downloads/CFB.csv")
head(CFB)
## Team NIL
## 1 Texas 22272474
## 2 Ohio State 20253400
## 3 LSU 20137141
## 4 Georgia 18326566
## 5 Texas A&M 17228714
## 6 Michigan 16357054
aplpack::stem.leaf(CFB$NIL)
## 1 | 2: represents 1.2e+07
## leaf unit: 1e+06
## n: 55
## 8 t | 23333333
## 16 f | 45555555
## 27 s | 66677777777
## (8) 0. | 88899999
## 20 1* | 001111
## 14 t | 2333
## 10 f | 4555
## 6 s | 67
## 4 1. | 8
## 3 2* | 00
## 1 t | 2
hist(CFB$NIL)
lines(density(CFB$NIL, bw=1.5), lwd=2)
plot(density(CFB$NIL, bw=1.5), lwd=2,
axes=FALSE,
xlab="" ,
ylab="",
main="")
box()
par(mfrow=c(2,2))
hist(CFB$NIL, main="Raw")
hist(sqrt(+.05),main="ROOTS")
hist((+.05)^0.001, main="p=0.001")
aplpack::stem.leaf(CFB$NIL)
## 1 | 2: represents 1.2e+07
## leaf unit: 1e+06
## n: 55
## 8 t | 23333333
## 16 f | 45555555
## 27 s | 66677777777
## (8) 0. | 88899999
## 20 1* | 001111
## 14 t | 2333
## 10 f | 4555
## 6 s | 67
## 4 1. | 8
## 3 2* | 00
## 1 t | 2
(letter.values <-lval(CFB$NIL))
## depth lo hi mids spreads
## M 28.0 8355617 8355617 8355617 0
## H 14.5 5804650 12191232 8997941 6386582
## E 7.5 3958874 15898822 9928848 11939948
## D 4.0 3308993 18326566 10817780 15017573
## C 2.5 3190207 20195271 11692739 17005064
## B 1.0 2098333 22272474 12185404 20174141
select(letter.values, mids)
## mids
## M 8355617
## H 8997941
## E 9928848
## D 10817780
## C 11692739
## B 12185404
letter.values %>% mutate(LV=1:6) %>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Raw Data")
roots <-sqrt(CFB$NIL)
aplpack::stem.leaf(roots)
## 1 | 2: represents 1200
## leaf unit: 100
## n: 55
## 1 f | 4
## 3 s | 77
## 8 1. | 89999
## 9 2* | 0
## 14 t | 33333
## 18 f | 4455
## 26 s | 66666777
## (4) 2. | 8899
## 25 3* | 000011
## 19 t | 233
## 16 f | 445
## 13 s | 667
## 10 3. | 8999
## 6 4* | 01
## 4 t | 2
## 3 f | 45
## 1 s | 7
(root.lv <-lval(roots))
## depth lo hi mids spreads
## M 28.0 2890.608 2890.608 2890.608 0.000
## H 14.5 2409.166 3490.575 2949.871 1081.408
## E 7.5 1989.681 3987.314 2988.498 1997.633
## D 4.0 1819.064 4280.954 3050.009 2461.890
## C 2.5 1786.099 4493.910 3140.005 2707.811
## B 1.0 1448.562 4719.372 3083.967 3270.810
root.lv %>% mutate(LV= 1:6)%>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Root Data")
logs <-log(CFB$NIL)
aplpack::stem.leaf(logs)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 55
## 1 f | 5
## s |
## 3 14. | 99
## 8 15* | 01111
## 9 t | 2
## 16 f | 4455555
## 23 s | 6677777
## (6) 15. | 888899
## 26 16* | 00000011
## 18 t | 222233
## 12 f | 445555
## 6 s | 667
## 3 16. | 889
root.lv %>% mutate(LV= 1:6)%>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Log Data")
recroots <- -1/sqrt(CFB$NIL)
aplpack::stem.leaf(recroots)
## 1 | 2: represents 0.00012
## leaf unit: 1e-05
## n: 55
## LO: -0.000690339612819376
## 3 -5. | 65
## 8 -5* | 42100
## 9 -4. | 8
## 16 -4* | 3322111
## 27 -3. | 99777776655
## (10) -3* | 4332222210
## 18 -2. | 999977765555
## 6 -2* | 443221
This data set shows a right-skewed distribution. After applying both square root and logarithmic transformations, the shape becomes more symmetric. The log transformation produces the most balanced distribution.
ppg <- read.csv("C:/Users/KayVog22/Downloads/Creating Data - Cavs_BullsPPG.csv")
head(ppg)
## Player PTS
## 1 Donovan Mitchell 24.0
## 2 Darius Garland 20.6
## 3 Evan Mobley 18.5
## 4 De'Andre Hunter 14.3
## 5 Jarrett Allen 13.5
## 6 Ty Jerome 12.5
aplpack::stem.leaf(ppg$PTS, m=3)
## 1 | 2: represents 12
## leaf unit: 1
## n: 43
## 10 0 | 1111122233
## 19 0 | 333444566
## (10) 0 | 6777888899
## 14 1 | 01223
## 9 1 | 344
## 6 1 | 88
## 4 2 | 00
## 2 2 | 44
hist(ppg$PTS)
lines(density(ppg$PTS, bw=1.5), lwd=2)
plot(density(ppg$PTS, bw=1.5), lwd=2,
axes=FALSE,
xlab="" ,
ylab="",
main="")
box()
par(mfrow=c(2,2))
hist(ppg$PTS, main="Raw")
hist(sqrt(ppg$PTS+.05),main="ROOTS")
hist((ppg$PTS+.05)^0.001, main="p=0.001")
aplpack::stem.leaf(ppg$PTS)
## 1 | 2: represents 12
## leaf unit: 1
## n: 43
## 5 0* | 11111
## 13 t | 22233333
## 17 f | 4445
## (6) s | 666777
## 20 0. | 888899
## 14 1* | 01
## 12 t | 2233
## 8 f | 44
## s |
## 6 1. | 88
## 4 2* | 00
## t |
## 2 f | 44
(letter.values<-lval(ppg$PTS))
## depth lo hi mids spreads
## M 22.0 7.20 7.2 7.200 0.00
## H 11.5 3.65 12.4 8.025 8.75
## E 6.0 2.00 18.5 10.250 16.50
## D 3.5 1.75 20.5 11.125 18.75
## C 2.0 1.70 24.0 12.850 22.30
## B 1.0 1.00 24.0 12.500 23.00
select(letter.values, mids)
## mids
## M 7.200
## H 8.025
## E 10.250
## D 11.125
## C 12.850
## B 12.500
letter.values %>% mutate(LV=1:6) %>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Raw Data")
roots<-sqrt(ppg$PTS)
aplpack::stem.leaf(roots)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 43
## 7 1* | 0333344
## 13 1. | 578899
## 18 2* | 01134
## (9) 2. | 566678999
## 16 3* | 0013
## 12 3. | 556678
## 6 4* | 33
## 4 4. | 5588
(root.lv <-lval(roots))
## depth lo hi mids spreads
## M 22.0 2.683282 2.683282 2.683282 0.000000
## H 11.5 1.910453 3.521335 2.715894 1.610882
## E 6.0 1.414214 4.301163 2.857688 2.886949
## D 3.5 1.322741 4.527679 2.925210 3.204938
## C 2.0 1.303840 4.898979 3.101410 3.595139
## B 1.0 1.000000 4.898979 2.949490 3.898979
roots<-sqrt(ppg$PTS)
aplpack::stem.leaf(roots)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 43
## 7 1* | 0333344
## 13 1. | 578899
## 18 2* | 01134
## (9) 2. | 566678999
## 16 3* | 0013
## 12 3. | 556678
## 6 4* | 33
## 4 4. | 5588
(root.lv <- (roots))
## [1] 4.898979 4.538722 4.301163 3.781534 3.674235 3.535534 3.193744 3.065942
## [9] 2.949576 2.683282 2.683282 2.469818 2.323790 1.923538 1.923538 1.897367
## [17] 1.816590 1.760682 1.581139 1.303840 1.000000 4.898979 4.516636 4.301163
## [25] 3.820995 3.633180 3.507136 3.391165 3.000000 2.932576 2.932576 2.863564
## [33] 2.756810 2.626785 2.549510 2.144761 2.121320 2.073644 1.449138 1.414214
## [41] 1.341641 1.341641 1.303840
roots <- sqrt(ppg$PTS)
root.lv <- lval(roots)
root.lv %>%
mutate(LV = 1:6) %>%
ggplot(aes(LV, mids)) +
geom_point() +
ggtitle("Root Data")
logs<-log(lake$Depth)
aplpack::stem.leaf(logs)
## 1 | 2: represents 1.2
## leaf unit: 0.1
## n: 71
## 3 1. | 999
## 6 2* | 111
## 9 t | 333
## 11 f | 55
## 18 s | 6666777
## 26 2. | 88888899
## 32 3* | 011111
## (6) t | 222223
## 33 f | 444444445555
## 21 s | 66666777
## 13 3. | 8899
## 9 4* | 00001
## 4 t | 222
## 1 f | 4
(logs.lv<-lval(logs))
## depth lo hi mids spreads
## M 36.0 3.258097 3.258097 3.258097 0.0000000
## H 18.5 2.802901 3.663562 3.233231 0.8606606
## E 9.5 2.481422 3.959678 3.220550 1.4782558
## D 5.0 2.197225 4.174387 3.185806 1.9771627
## C 3.0 1.945910 4.262680 3.104295 2.3167697
## B 2.0 1.945910 4.262680 3.104295 2.3167697
## A 1.0 1.945910 4.488636 3.217273 2.5427262
logs.lv %>% mutate(LV=1:7) %>%
ggplot(aes(LV, mids))+
geom_point()+ggtitle("Log Data")
This data set shows a right-skewed distribution. After applying both
square root and logarithmic transformations, the shape becomes more
symmetric. The log transformation produces the most balanced
distribution.