Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- times = c("2015-12-30 20:00:00", "2016-01-06 20:00:00",
- "2016-01-08 20:00:00", "2016-01-11 20:00:00",
- "2016-01-13 20:00:00", "2016-01-14 20:00:00",
- "2016-01-15 20:00:00", "2016-01-18 20:00:00",
- "2016-01-20 20:00:00", "2016-01-21 20:00:00",
- "2016-01-25 20:00:00")
- counts = c(7, 14, 61, 1, 2, 66, 10, 35, 1, 304, 2)
- df <- data.frame(timestamp = as.POSIXct(times, format="%Y-%m-%d %H:%M:%S",
- tz="Pacific/Auckland"),
- count = counts)
- hist(df$count)
- qqnorm(df$count)
- qqline(df$count)
- lambda <- geoR::boxcoxfit(df$count)$lambda
- df$transformed <- car::bcPower(df$count, lambda=lambda)
- timestamp count transformed zscore
- 1 2015-12-30 20:00:00 7 1.7922836 -0.14446864
- 2 2016-01-06 20:00:00 14 2.3618561 0.22598616
- 3 2016-01-08 20:00:00 61 3.4646761 0.94326978
- 4 2016-01-11 20:00:00 1 0.0000000 -1.31018523
- 5 2016-01-13 20:00:00 2 0.6729577 -0.87248782
- 6 2016-01-14 20:00:00 66 3.5198741 0.97917102
- 7 2016-01-15 20:00:00 10 2.0895953 0.04890541
- 8 2016-01-18 20:00:00 35 3.0646823 0.68311037
- 9 2016-01-20 20:00:00 1 0.0000000 -1.31018523
- 10 2016-01-21 20:00:00 304 4.5195550 1.62937200
- 11 2016-01-25 20:00:00 2 0.6729577 -0.87248782
Add Comment
Please, Sign In to add comment