-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
320 lines (320 loc) · 18 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/Onion_2020_correction2_weeklyAvg.csv")
install.packages("oddsratio")
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/Onion_2020_correction2_weeklyAvg.csv")
data1
colnames(data1) <- c("w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
data1
colnames(data1) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
data1
library(oddsratio)
install.packages("forecast")
install.packages("timeSeries")
install.packages("timeDate")
install.packages("forecast")
install.packages("MASS")
data1
library(dplyr)
library(oddsratio)
glimpse(data1)
data1
sapply(data1, mean, na.rm=TRUE)
summary(data1)
View(summary(data1))
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/copy.csv")
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/copy.csv")
data1
glimpse(data1)
sapply(data1, mean, na.rm=TRUE)
View(summary(data1))
summary(data1)
summary(data1[1])
summary(data1[2])
View(data1)
plot(data1, (x="week", y="Chattisgarh"))
plot(data1, aes(x="week", y="Chattisgarh"))
library(ggplot2)
plot(data1, aes(x="week", y="Chattisgarh"))
boxplot(data1$Chattisgarh)
plot(week, Chattisgarh)
plot(weeks, Chattisgarh)
weeks <- data1[1]
col1 <- data[2]
col1 <- data1[2]
plot(weeks, col1)
col1
weeks
length(weeks)
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/copy.csv")
weeks <- data1[1]
weeks
length()
col1 <- data1[2]
col1
plot(weeks, col1)
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/copy.csv")
weeks <- data1[1]
weeks
length()
col1 <- data1[2]
col1
plot(weeks, col1)
plot(data1, aes(x=week, y=Chattisgarh))
ggplot(data1, aes(x=week, y=Chattisgarh))
install.packages("psych")
summary(data1)
glimpse(data1)
sapply(data1, mean, na.rm=TRUE)
ggplot(data1, aes(x=week, y=Chattisgarh))
ggplot(data1, aes(x=week, y=Gujarat))
ggplot(data1, aes(x=week, y=Gujarat))+ geom_line(color = "red")
library(ggplot2)
ggplot(data1, aes(x=week, y=Gujarat))+ geom_line(color = "red")
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Onion/copy.csv")
summary(data1)
summary(data1[2:9])
summary(data1[2:16])
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Onion_2020_correction3_weeklyAvg.csv")
summary(data1[2:16])
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Onion_2020_correction2_weeklyAvg.csv")
summary(data1)
summary(data1[2:9])
colnames(data1) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
summary(data1[2:9])
data1 <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Onion_2020_correction3_weeklyAvg.csv")
summary(data1[2:16])
d+h
potato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Potato_2020_correction3_weeklyAvg.csv")
summary(data1[2:16])
potato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Potato_2020_correction2_weeklyAvg.csv")
colnames(data1) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
summary(data1[2:9])
potato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Potato_2020_correction3_weeklyAvg.csv")
summary(potato_state[2:16])
View(data1)
potato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Potato_2020_correction2_weeklyAvg.csv")
colnames(potato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
summary(potato_country[2:9])
tomato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Tomato_2020_correction3_weeklyAvg.csv")
summary(tomato_state[2:16])
tomato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Potato_2020_correction2_weeklyAvg.csv")
colnames(tomato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
summary(tomato_country[2:9])
tomato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Tomato_2020_correction2_weeklyAvg.csv")
colnames(tomato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
summary(tomato_country[2:9])
summary(tomato_state[2:16])
my_Object <- ts(tomato_state, start=w1 ,frequency = 15)
tomato_state
library(oddsratio)
library(dplyr)
library(ggplot2)
library(Metrics)
library(forecast)
library(reshape)
start(tomato_state)
my_Object <- ts(tomato_state, start=w1 ,frequency = 15)
my_Object <- ts(tomato_state, start="w1" ,frequency = 15)
boxplot(Chattishgarh$tomato_state)
boxplot(Chattisgarh$tomato_state)
boxplot(Chattisgarh$tomato_state)
boxplot(tomato_state$Chattisgarh)
boxplot(tomato_state$Chattisgarh,Gujarat)
boxplot(tomato_state$Chattisgarh$Gujarat)
boxplot(tomato_state$Chattisgarh)
outvalues = boxplot(tomato_state$Chattisgarh)$out
outvalues
############################
onion_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Onion_2020_correction3_weeklyAvg.csv")
summary(data1[2:16])
boxplot(onion_state$Chattisgarh)
outvalues = boxplot(onion_state$Chattisgarh)$out
boxplot(onion_state$Chattisgarh)
outvalues = boxplot(onion_state$Chattisgarh)$out
outvalues
start(tomato_state)
tomato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Tomato_2020_correction3_weeklyAvg.csv")
tomato_state
start(tomato_state)
tomato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Tomato_2020_correction3_weeklyAvg.csv")
tomato_state
start(tomato_state)
tomato_state.ts <- as.ts(tomato_state)
start(tomato_state)
my_Object <- ts(tomato_state, start="w1" ,frequency = 15)
my_Object <- ts(tomato_state, start=1 ,frequency = 15)
start(tomato_state)
my_Object <- ts(tomato_state, start=1 ,frequency = 15)
my_Object
boxplot(my_Object~cycle(my_Object),xlab="Month",ylab = "Deaths",main = "Death from lung
disease")
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
tomato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Tomato_2020_correction3_weeklyAvg.csv")
tomato_state
tomato_state.ts <- as.ts(tomato_state)
my_Object <- ts(tomato_state, start=1 ,frequency = 15)
my_Object <- ts(tomato_state, start=w1 ,frequency = 15)
tomato_state.ts <- as.ts(tomato_state)
my_Object <- ts(tomato_state, start=w1 ,frequency = 15)
my_Object <- ts(tomato_state, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
my_Object
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
outvalues
tomato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Tomato_2020_correction2_weeklyAvg.csv")
colnames(tomato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
summary(tomato_country[2:9])
potato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Potato_2020_correction3_weeklyAvg.csv")
potato_state.ts <- as.ts(potato_state)
my_Object <- ts(potato_state, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
outvalues
potato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Potato_2020_correction2_weeklyAvg.csv")
colnames(potato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
ppotato_country.ts <- as.ts(potato_country)
potato_country.ts <- as.ts(potato_country)
my_Object <- ts(potato_country, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
outvalues
my_Object <- ts(potato_country, start=2,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
my_Object <- ts(potato_country, start=2,frequency = 16)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
my_Object <- ts(potato_country, start=1,frequency = 16)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
tomato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Tomato_2020_correction2_weeklyAvg.csv")
colnames(tomato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
tomato_country.ts <- as.ts(tomato_country)
my_Object <- ts(tomato_country, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
outvalues
tomato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Tomato_2020_correction3_weeklyAvg.csv")
tomato_state
tomato_state.ts <- as.ts(tomato_state)
my_Object <- ts(tomato_state, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
my_Object <- ts(tomato_state, start=1,frequency = 8)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
outvalues
summary(tomato_state[2:16])
tomato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Tomato_2020_correction2_weeklyAvg.csv")
colnames(tomato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
tomato_country.ts <- as.ts(tomato_country)
my_Object <- ts(tomato_country, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in 15 states")
tomato_country.ts <- as.ts(tomato_country)
my_Object <- ts(tomato_country, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="states",ylab = "8 weeks_price",main = "Prices of tomato in 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="states",ylab = "8 weeks_price",main = "Prices of tomato in 15 states")$out
outvalues
potato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Potato_2020_correction2_weeklyAvg.csv")
colnames(potato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
potato_country.ts <- as.ts(potato_country)
my_Object <- ts(potato_country, start=1,frequency = 16)
boxplot(my_Object~cycle(my_Object),xlab="states",ylab = "8 weeks_price",main = "Prices of potato in 15 states")
potato_country
tomato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Tomato_2020_correction2_weeklyAvg.csv")
colnames(tomato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
tomato_country.ts <- as.ts(tomato_country)
my_Object <- ts(tomato_country, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="states",ylab = "8 weeks_price",main = "Prices of tomato in 15 states")
tomato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Tomato_2020_correction3_weeklyAvg.csv")
tomato_state
tomato_state.ts <- as.ts(tomato_state)
my_Object <- ts(tomato_state, start=1,frequency = 8)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
potato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Potato_2020_correction3_weeklyAvg.csv")
potato_state.ts <- as.ts(potato_state)
my_Object <- ts(potato_state, start=1,frequency = 15)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
my_Object <- ts(potato_state, start=1,frequency = 8)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
potato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Potato_2020_correction3_weeklyAvg.csv")
potato_state.ts <- as.ts(potato_state)
my_Object <- ts(potato_state, start=1,frequency = 8)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")$out
potato_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Potato_2020_correction2_weeklyAvg.csv")
potato_country
colnames(potato_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
potato_country.ts <- as.ts(potato_country)
my_Object <- ts(potato_country, start=1,frequency = 16)
boxplot(my_Object~cycle(my_Object),xlab="states",ylab = "8 weeks_price",main = "Prices of potato in 15 states")
potato_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Potato_2020_correction3_weeklyAvg.csv")
potato_state.ts <- as.ts(potato_state)
my_Object <- ts(potato_state, start=1,frequency = 8)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of tomato in the country considering 15 states")
View(potato_state)
############################
onion_state <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/state/Onion_2020_correction3_weeklyAvg.csv")
onion_state.ts <- as.ts(onion_state)
my_Object <- ts(onion_state, start=1,frequency = 8)
boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of onion in the country considering 15 states")
outvalues = boxplot(my_Object~cycle(my_Object),xlab="weeks",ylab = "states_price",main = "Prices of onion in the country considering 15 states")$out
outvalues
summary(data1[2:16])
onion_country <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/country/Onion_2020_correction2_weeklyAvg.csv")
colnames(onion_country) <- c("states", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8")
potato_country.ts <- as.ts(onion_country)
my_Object <- ts(onion_country, start=1,frequency = 16)
boxplot(my_Object~cycle(my_Object),xlab="states",ylab = "8 weeks_price",main = "Prices of potato in 15 states")
View(onion_country)
library(oddsratio)
library(ggplot2)
library(reshape)
x <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Dataset - Sheet8 (2).csv")
data <- as.data.frame(x)
fit_glm <- glm(data$Y ~ data$Onion_price + data$Tomato_price + data$Potato.Price + data$Cabbage_price + data$Bhindi_price + data$Cauliflower_price + data$Brinjal_Price, data = data, family = "binomial")
or_glm(data = data_glm, model = fit_glm)
exp(coef(fit_glm))[-1] # prints oddsratio separatley
summary(fit_glm)
como <- read.csv("/home/dheeraj/my_projects/my_project_env/practice/COVID19-Analysis-on-Vegetable_prices/Dataset - Sheet4.csv")
como
df_como <- as.data.frame(como)
df_como
col <- c("onion","tomato","potato","cabbage","bhindi","cauliflower","brinjal")
r <- c("week_1","week_2","week_3","week_4","week_5","week_6","week_7","week_8")
final_data<-data.frame(matrix(ncol = 7, nrow = 8))
colnames(final_data) <- col
rownames(final_data) <- r
for (i in 2:69){
x <- df_como[,i]
x[is.na(x)] <- 0
df_como[,i] <- x
}
temp <-data.frame(matrix(ncol =70, nrow = 1))
for(i in 2:69){
y <- mean(df_como[,i])
temp[,i]<- y
}
s <- 2
e <- 9
for(i in 1:7){
arr <- temp[s:e]
print((arr))
for(k in 1:8){
final_data[k,i] <- arr[k]
}
s <- s + 10
e <- e + 10
}
Week <- seq(1,8,1)
df <- data.frame(Week,final_data)
df.m <- melt(df,id.vars = "Week")
ggplot(data = df.m,aes(x = Week, y = value, group = variable, color = variable)) + geom_line(size = 1)
ggplot(data = df.m,aes(x = Week, y = value, group = variable, color = variable)) + geom_line(size = 2)
abline(ggplot(data = df.m,aes(x = Week, y = value, group = variable, color = variable)) + geom_line(size = 2)
)
ggplot(data = df.m,aes(x = Week, y = value, group = variable, color = variable)) + geom_line(size = 2)
library(forecast)
library(forecast)
library(ggplot2)
library(Metrics)
library(forecast)
library(reshape)