Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre1.8.0_144')
library(outliers)
crime_df = read.table("C:\\Users\\vabhagat\\Downloads\\uscrime.txt", header= TRUE, stringsAsFactors = F)
head(crime_df)
10 is a test for one outlier (side is detected automatically and can be reversed by opposite parameter). 11 is a test for two outliers on opposite tails, 20 is test for two outliers in one tail. Therefore, I chose type = 11
grubbs.test(crime_df[,16], type = 11, opposite = FALSE, two.sided = FALSE )
##
## Grubbs test for two opposite outliers
##
## data: crime_df[, 16]
## G = 4.26880, U = 0.78103, p-value = 1
## alternative hypothesis: 342 and 1993 are outliers
Since p-value = 1,both the highest and lowest values in the “Crime” column are within the expected standard of deviation and are not outliers.
Where I live there has been cooler than average temperatures for the last two weeks. The drop has been significant enough that I have considered getting my winter clothes out of storage and putting away my summer wardrobe. Since I have limited closet space, this is an either/or type of situation and requires a significant enough time investment that I don’t want to make the mistake of putting warm-weather clothes away too early. It would be good to know if these cooler temperatures are just outliers (or a result of the outlier that is Hurricane Florence) or if they will be sustained. I would choose the Threshold based on average low temperatures for this time of year in my city and a critical value that is relatively large so that my model would be less sensitive to changes given the high variability of weather and wanting to avoid a false positive (deciding to put away summer clothes too early) more.
Please refer to the excel attached on the portal.
St = MAX(0,St(previous day)+([temp on day(x)/year(y)] - Mu - C)) Mu = 83.34 This is the average temperature across all days and years in the dataset
Based on Plot 1, it appears that the weather change happens towards the end of Aug.
Please refer to the excel attached on the portal.
Based on plot 2, though there has been variance in temprature over time, but there wasn’t really a pivotal year when the shift started happening.