cor(x, y, method = c(“pearson”, “kendall”, “spearman”)) cor.test(x, y, method=c(“pearson”, “kendall”, “spearman”)) When there are missing variables, use the code below- cor(x, y, method = “pearson”, use = “complete.obs”)
#mostcommonly used correlation is pearson correlation
library(readr)
Sumita_Addicon <- read_csv("~/Documents/OneDrive/2_Apple/sumita/Sumita_Addicon.csv")
## New names:
## Rows: 34 Columns: 15
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (2): State/UT, percentage...15 dbl (13): population_million, Population, total
## crime, COTPA, GATS-2, men, w...
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `percentage` -> `percentage...12`
## • `percentage` -> `percentage...15`
library(tigerstats)
## Loading required package: abd
## Loading required package: nlme
## Loading required package: lattice
## Loading required package: grid
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
##
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
##
## The following object is masked from 'package:Matrix':
##
## mean
##
## The following object is masked from 'package:ggplot2':
##
## stat
##
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
##
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
##
## Welcome to tigerstats!
## To learn more about this package, consult its website:
## http://homerhanumat.github.io/tigerstats
favstats(Sumita_Addicon$population_cotpa~ Sumita_Addicon$`State/UT`, data = Sumita_Addicon) [c("Sumita_Addicon$`State/UT`", "mean")]
How to visualise data
library("ggpubr")
ggscatter(Sumita_Addicon, x = "population_cotpa", y = "GATS-2",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "COTPA cases per million", ylab = "Tobacco prevalence GATS-2")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 2 rows containing non-finite values (`stat_cor()`).
## Warning: Removed 2 rows containing missing values (`geom_point()`).
# There is no correlation between prevalence of tobacco use and COTPA cases
cor.test(Sumita_Addicon$population_cotpa, Sumita_Addicon$`GATS-2`, method = c("pearson"))
##
## Pearson's product-moment correlation
##
## data: x and y
## t = -0.91972, df = 30, p-value = 0.3651
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.4862171 0.1943154
## sample estimates:
## cor
## -0.165599
ggscatter(Sumita_Addicon, x = "population_cotpa", y = "population_crimes",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "COTPA cases per million", ylab = "Crimes recorded oer million")
## `geom_smooth()` using formula = 'y ~ x'
# There is no correlation between crime cases for the states and COTPA cases
cor.test(Sumita_Addicon$population_cotpa, Sumita_Addicon$population_crimes, method = c("pearson"))
##
## Pearson's product-moment correlation
##
## data: x and y
## t = 7.6161, df = 32, p-value = 1.119e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.6377516 0.8973442
## sample estimates:
## cor
## 0.8027843
Smoking and smokeless tobacco use
ggscatter(Sumita_Addicon, x = "population_cotpa", y = "smokeless",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "COTPA cases per million", ylab = "smokeless")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 2 rows containing non-finite values (`stat_cor()`).
## Warning: Removed 2 rows containing missing values (`geom_point()`).
# There is no correlation between crime cases for the states and smokeless tobacco
cor.test(Sumita_Addicon$population_cotpa, Sumita_Addicon$smokeless, method = c("pearson"))
##
## Pearson's product-moment correlation
##
## data: x and y
## t = -0.89323, df = 30, p-value = 0.3788
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.4825651 0.1989025
## sample estimates:
## cor
## -0.1609546
ggscatter(Sumita_Addicon, x = "population_cotpa", y = "smoke",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "COTPA cases per million", ylab = "smoking")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 2 rows containing non-finite values (`stat_cor()`).
## Warning: Removed 2 rows containing missing values (`geom_point()`).
# There is no correlation between crime cases for the states and smoking
cor.test(Sumita_Addicon$population_cotpa, Sumita_Addicon$smoke, method = c("pearson"))
##
## Pearson's product-moment correlation
##
## data: x and y
## t = 0.088645, df = 30, p-value = 0.93
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.3343987 0.3628289
## sample estimates:
## cor
## 0.0161822
#men and women
ggscatter(Sumita_Addicon, x = "population_cotpa", y = "women",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "COTPA cases per million", ylab = "Tobacco use in women")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 2 rows containing non-finite values (`stat_cor()`).
## Warning: Removed 2 rows containing missing values (`geom_point()`).
# There is no correlation between tobacco use in women for the states and COTPA cases
cor.test(Sumita_Addicon$population_cotpa, Sumita_Addicon$women, method = c("pearson"))
##
## Pearson's product-moment correlation
##
## data: x and y
## t = -0.44337, df = 30, p-value = 0.6607
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.4176283 0.2757686
## sample estimates:
## cor
## -0.08068386
ggscatter(Sumita_Addicon, x = "population_cotpa", y = "men",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "COTPA cases per million", ylab = "tobacco use in men")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 2 rows containing non-finite values (`stat_cor()`).
## Warning: Removed 2 rows containing missing values (`geom_point()`).
# There is no correlation between COTPA for the states and tobacco use in men
cor.test(Sumita_Addicon$population_cotpa, Sumita_Addicon$men, method = c("pearson"))
##
## Pearson's product-moment correlation
##
## data: x and y
## t = -0.96119, df = 30, p-value = 0.3441
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.4918939 0.1871254
## sample estimates:
## cor
## -0.1728467
We intend to do a time series as we have data for 5 years (2017-2021)
library(readr)
COTPA_Time_series <- read_csv("~/Documents/OneDrive/2_Apple/sumita/COTPA_Time_series.csv")
## Rows: 5 Columns: 37
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (37): Year, Andhra Pradesh, Arunachal Pradesh, Assam, Bihar, Chhattisgar...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
attach(COTPA_Time_series)
summary(COTPA_Time_series)
## Year Andhra Pradesh Arunachal Pradesh Assam Bihar
## Min. :2017 Min. :0.0 Min. :0 Min. :0 Min. :0
## 1st Qu.:2018 1st Qu.:0.1 1st Qu.:0 1st Qu.:0 1st Qu.:0
## Median :2019 Median :0.3 Median :0 Median :0 Median :0
## Mean :2019 Mean :0.3 Mean :0 Mean :0 Mean :0
## 3rd Qu.:2020 3rd Qu.:0.3 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0
## Max. :2021 Max. :0.8 Max. :0 Max. :0 Max. :0
## Chhattisgarh Goa Gujarat Haryana Himachal Pradesh
## Min. :0.0 Min. :0.00 Min. :0.1 Min. :0 Min. :0
## 1st Qu.:0.1 1st Qu.:0.00 1st Qu.:0.1 1st Qu.:0 1st Qu.:0
## Median :0.1 Median :0.00 Median :0.1 Median :0 Median :0
## Mean :0.2 Mean :0.22 Mean :0.1 Mean :0 Mean :0
## 3rd Qu.:0.2 3rd Qu.:0.10 3rd Qu.:0.1 3rd Qu.:0 3rd Qu.:0
## Max. :0.6 Max. :1.00 Max. :0.1 Max. :0 Max. :0
## Jharkhand Karnataka Kerala Madhya Pradesh Maharashtra
## Min. :0.00 Min. :0.30 Min. : 5.00 Min. :0 Min. :0.10
## 1st Qu.:0.00 1st Qu.:0.40 1st Qu.: 7.40 1st Qu.:0 1st Qu.:0.50
## Median :0.00 Median :0.50 Median :14.30 Median :0 Median :0.60
## Mean :0.02 Mean :0.44 Mean :12.38 Mean :0 Mean :0.52
## 3rd Qu.:0.00 3rd Qu.:0.50 3rd Qu.:16.40 3rd Qu.:0 3rd Qu.:0.70
## Max. :0.10 Max. :0.50 Max. :18.80 Max. :0 Max. :0.70
## Manipur Meghalaya Mizoram Nagaland Odisha
## Min. :0.00 Min. :0 Min. :0.00 Min. :0.00 Min. :0
## 1st Qu.:0.00 1st Qu.:0 1st Qu.:0.00 1st Qu.:0.00 1st Qu.:0
## Median :0.00 Median :0 Median :0.00 Median :0.00 Median :0
## Mean :0.08 Mean :0 Mean :0.04 Mean :0.02 Mean :0
## 3rd Qu.:0.10 3rd Qu.:0 3rd Qu.:0.00 3rd Qu.:0.00 3rd Qu.:0
## Max. :0.30 Max. :0 Max. :0.20 Max. :0.10 Max. :0
## Punjab Rajasthan Sikkim Tamil Nadu Telangana
## Min. :0.00 Min. :1.70 Min. :0 Min. :17.50 Min. :0.80
## 1st Qu.:0.00 1st Qu.:1.80 1st Qu.:0 1st Qu.:19.20 1st Qu.:1.10
## Median :0.00 Median :2.40 Median :0 Median :29.60 Median :1.30
## Mean :0.02 Mean :2.22 Mean :0 Mean :36.62 Mean :1.28
## 3rd Qu.:0.00 3rd Qu.:2.40 3rd Qu.:0 3rd Qu.:56.10 3rd Qu.:1.30
## Max. :0.10 Max. :2.80 Max. :0 Max. :60.70 Max. :1.90
## Tripura Uttar Pradesh Uttarakhand West Bengal A&N Islands
## Min. :0 Min. :0 Min. : 0.10 Min. :0 Min. :0
## 1st Qu.:0 1st Qu.:0 1st Qu.: 0.50 1st Qu.:0 1st Qu.:0
## Median :0 Median :0 Median : 1.30 Median :0 Median :0
## Mean :0 Mean :0 Mean : 4.06 Mean :0 Mean :0
## 3rd Qu.:0 3rd Qu.:0 3rd Qu.: 7.40 3rd Qu.:0 3rd Qu.:0
## Max. :0 Max. :0 Max. :11.00 Max. :0 Max. :0
## Chandigarh D&N Haveli and\nDaman & Diu Delhi Jammu & Kashmir
## Min. :0 Min. :0.00 Min. :0.0 Min. :0
## 1st Qu.:0 1st Qu.:0.00 1st Qu.:0.0 1st Qu.:0
## Median :0 Median :0.00 Median :0.1 Median :0
## Mean :0 Mean :0.04 Mean :0.1 Mean :0
## 3rd Qu.:0 3rd Qu.:0.00 3rd Qu.:0.1 3rd Qu.:0
## Max. :0 Max. :0.20 Max. :0.3 Max. :0
## Lakshadweep Puducherry Average
## Min. :0.00 Min. :1.5 Min. :1.3
## 1st Qu.:0.00 1st Qu.:3.5 1st Qu.:1.3
## Median :1.40 Median :4.3 Median :1.6
## Mean :0.88 Mean :3.9 Mean :1.8
## 3rd Qu.:1.50 3rd Qu.:4.3 3rd Qu.:2.4
## Max. :1.50 Max. :5.9 Max. :2.4
library(dplyr)
COTPA_Time_series_2 <- select(COTPA_Time_series,-1)
COTPA_Time_series_3 <- scale(COTPA_Time_series_2)
COTPA_Time_series_3
## Andhra Pradesh Arunachal Pradesh Assam Bihar Chhattisgarh Goa
## [1,] -0.9733285 NaN NaN NaN -8.528029e-01 1.7800983
## [2,] -0.6488857 NaN NaN NaN -4.264014e-01 -0.5020790
## [3,] 0.0000000 NaN NaN NaN 1.705606e+00 -0.2738613
## [4,] 0.0000000 NaN NaN NaN 1.183502e-16 -0.5020790
## [5,] 1.6222142 NaN NaN NaN -4.264014e-01 -0.5020790
## Gujarat Haryana Himachal Pradesh Jharkhand Karnataka Kerala
## [1,] NaN NaN NaN -0.4472136 0.6708204 1.0839091
## [2,] NaN NaN NaN -0.4472136 -0.4472136 0.6787094
## [3,] NaN NaN NaN -0.4472136 0.6708204 0.3241597
## [4,] NaN NaN NaN 1.7888544 0.6708204 -1.2459889
## [5,] NaN NaN NaN -0.4472136 -1.5652476 -0.8407893
## Madhya Pradesh Maharashtra Manipur Meghalaya Mizoram Nagaland
## [1,] NaN -1.68676059 -0.613572 NaN -0.4472136 -0.4472136
## [2,] NaN 0.72289740 -0.613572 NaN -0.4472136 -0.4472136
## [3,] NaN 0.32128773 1.687323 NaN -0.4472136 -0.4472136
## [4,] NaN -0.08032193 0.153393 NaN -0.4472136 1.7888544
## [5,] NaN 0.72289740 -0.613572 NaN 1.7888544 -0.4472136
## Odisha Punjab Rajasthan Sikkim Tamil Nadu Telangana Tripura
## [1,] NaN -0.4472136 -1.1293678 NaN -0.3427830 -1.1925696 NaN
## [2,] NaN -0.4472136 -0.9121817 NaN -0.8506097 0.0496904 NaN
## [3,] NaN -0.4472136 1.2596795 NaN -0.9336198 -0.4472136 NaN
## [4,] NaN 1.7888544 0.3909350 NaN 0.9511984 1.5404024 NaN
## [5,] NaN -0.4472136 0.3909350 NaN 1.1758140 0.0496904 NaN
## Uttar Pradesh Uttarakhand West Bengal A&N Islands Chandigarh
## [1,] NaN -0.8113289 NaN NaN NaN
## [2,] NaN -0.5654717 NaN NaN NaN
## [3,] NaN -0.7293765 NaN NaN NaN
## [4,] NaN 1.4218744 NaN NaN NaN
## [5,] NaN 0.6843027 NaN NaN NaN
## D&N Haveli and\nDaman & Diu Delhi Jammu & Kashmir Lakshadweep
## [1,] -0.4472136 -0.8164966 NaN -1.0940333
## [2,] 1.7888544 0.0000000 NaN -1.0940333
## [3,] -0.4472136 -0.8164966 NaN 0.7707962
## [4,] -0.4472136 0.0000000 NaN 0.6464742
## [5,] -0.4472136 1.6329932 NaN 0.7707962
## Puducherry Average
## [1,] 0.25 -0.3563483
## [2,] 0.25 -0.8908708
## [3,] 1.25 -0.8908708
## [4,] -0.25 1.0690450
## [5,] -1.50 1.0690450
## attr(,"scaled:center")
## Andhra Pradesh Arunachal Pradesh
## 0.30 0.00
## Assam Bihar
## 0.00 0.00
## Chhattisgarh Goa
## 0.20 0.22
## Gujarat Haryana
## 0.10 0.00
## Himachal Pradesh Jharkhand
## 0.00 0.02
## Karnataka Kerala
## 0.44 12.38
## Madhya Pradesh Maharashtra
## 0.00 0.52
## Manipur Meghalaya
## 0.08 0.00
## Mizoram Nagaland
## 0.04 0.02
## Odisha Punjab
## 0.00 0.02
## Rajasthan Sikkim
## 2.22 0.00
## Tamil Nadu Telangana
## 36.62 1.28
## Tripura Uttar Pradesh
## 0.00 0.00
## Uttarakhand West Bengal
## 4.06 0.00
## A&N Islands Chandigarh
## 0.00 0.00
## D&N Haveli and\nDaman & Diu Delhi
## 0.04 0.10
## Jammu & Kashmir Lakshadweep
## 0.00 0.88
## Puducherry Average
## 3.90 1.80
## attr(,"scaled:scale")
## Andhra Pradesh Arunachal Pradesh
## 0.30822070 0.00000000
## Assam Bihar
## 0.00000000 0.00000000
## Chhattisgarh Goa
## 0.23452079 0.43817805
## Gujarat Haryana
## 0.00000000 0.00000000
## Himachal Pradesh Jharkhand
## 0.00000000 0.04472136
## Karnataka Kerala
## 0.08944272 5.92300599
## Madhya Pradesh Maharashtra
## 0.00000000 0.24899799
## Manipur Meghalaya
## 0.13038405 0.00000000
## Mizoram Nagaland
## 0.08944272 0.04472136
## Odisha Punjab
## 0.00000000 0.04472136
## Rajasthan Sikkim
## 0.46043458 0.00000000
## Tamil Nadu Telangana
## 20.47942870 0.40249224
## Tripura Uttar Pradesh
## 0.00000000 0.00000000
## Uttarakhand West Bengal
## 4.88088107 0.00000000
## A&N Islands Chandigarh
## 0.00000000 0.00000000
## D&N Haveli and\nDaman & Diu Delhi
## 0.08944272 0.12247449
## Jammu & Kashmir Lakshadweep
## 0.00000000 0.80436310
## Puducherry Average
## 1.60000000 0.56124861
time series
COTPA_Time_Series_Five_Years <- ts(COTPA_Time_series_3, frequency=1, start=c(2017,1))
COTPA_Time_Series_Five_Years
## Time Series:
## Start = 2017
## End = 2021
## Frequency = 1
## Andhra Pradesh Arunachal Pradesh Assam Bihar Chhattisgarh Goa
## 2017 -0.9733285 NaN NaN NaN -8.528029e-01 1.7800983
## 2018 -0.6488857 NaN NaN NaN -4.264014e-01 -0.5020790
## 2019 0.0000000 NaN NaN NaN 1.705606e+00 -0.2738613
## 2020 0.0000000 NaN NaN NaN 1.183502e-16 -0.5020790
## 2021 1.6222142 NaN NaN NaN -4.264014e-01 -0.5020790
## Gujarat Haryana Himachal Pradesh Jharkhand Karnataka Kerala
## 2017 NaN NaN NaN -0.4472136 0.6708204 1.0839091
## 2018 NaN NaN NaN -0.4472136 -0.4472136 0.6787094
## 2019 NaN NaN NaN -0.4472136 0.6708204 0.3241597
## 2020 NaN NaN NaN 1.7888544 0.6708204 -1.2459889
## 2021 NaN NaN NaN -0.4472136 -1.5652476 -0.8407893
## Madhya Pradesh Maharashtra Manipur Meghalaya Mizoram Nagaland
## 2017 NaN -1.68676059 -0.613572 NaN -0.4472136 -0.4472136
## 2018 NaN 0.72289740 -0.613572 NaN -0.4472136 -0.4472136
## 2019 NaN 0.32128773 1.687323 NaN -0.4472136 -0.4472136
## 2020 NaN -0.08032193 0.153393 NaN -0.4472136 1.7888544
## 2021 NaN 0.72289740 -0.613572 NaN 1.7888544 -0.4472136
## Odisha Punjab Rajasthan Sikkim Tamil Nadu Telangana Tripura
## 2017 NaN -0.4472136 -1.1293678 NaN -0.3427830 -1.1925696 NaN
## 2018 NaN -0.4472136 -0.9121817 NaN -0.8506097 0.0496904 NaN
## 2019 NaN -0.4472136 1.2596795 NaN -0.9336198 -0.4472136 NaN
## 2020 NaN 1.7888544 0.3909350 NaN 0.9511984 1.5404024 NaN
## 2021 NaN -0.4472136 0.3909350 NaN 1.1758140 0.0496904 NaN
## Uttar Pradesh Uttarakhand West Bengal A&N Islands Chandigarh
## 2017 NaN -0.8113289 NaN NaN NaN
## 2018 NaN -0.5654717 NaN NaN NaN
## 2019 NaN -0.7293765 NaN NaN NaN
## 2020 NaN 1.4218744 NaN NaN NaN
## 2021 NaN 0.6843027 NaN NaN NaN
## D&N Haveli and\nDaman & Diu Delhi Jammu & Kashmir Lakshadweep
## 2017 -0.4472136 -0.8164966 NaN -1.0940333
## 2018 1.7888544 0.0000000 NaN -1.0940333
## 2019 -0.4472136 -0.8164966 NaN 0.7707962
## 2020 -0.4472136 0.0000000 NaN 0.6464742
## 2021 -0.4472136 1.6329932 NaN 0.7707962
## Puducherry Average
## 2017 0.25 -0.3563483
## 2018 0.25 -0.8908708
## 2019 1.25 -0.8908708
## 2020 -0.25 1.0690450
## 2021 -1.50 1.0690450
## attr(,"scaled:center")
## Andhra Pradesh Arunachal Pradesh
## 0.30 0.00
## Assam Bihar
## 0.00 0.00
## Chhattisgarh Goa
## 0.20 0.22
## Gujarat Haryana
## 0.10 0.00
## Himachal Pradesh Jharkhand
## 0.00 0.02
## Karnataka Kerala
## 0.44 12.38
## Madhya Pradesh Maharashtra
## 0.00 0.52
## Manipur Meghalaya
## 0.08 0.00
## Mizoram Nagaland
## 0.04 0.02
## Odisha Punjab
## 0.00 0.02
## Rajasthan Sikkim
## 2.22 0.00
## Tamil Nadu Telangana
## 36.62 1.28
## Tripura Uttar Pradesh
## 0.00 0.00
## Uttarakhand West Bengal
## 4.06 0.00
## A&N Islands Chandigarh
## 0.00 0.00
## D&N Haveli and\nDaman & Diu Delhi
## 0.04 0.10
## Jammu & Kashmir Lakshadweep
## 0.00 0.88
## Puducherry Average
## 3.90 1.80
## attr(,"scaled:scale")
## Andhra Pradesh Arunachal Pradesh
## 0.30822070 0.00000000
## Assam Bihar
## 0.00000000 0.00000000
## Chhattisgarh Goa
## 0.23452079 0.43817805
## Gujarat Haryana
## 0.00000000 0.00000000
## Himachal Pradesh Jharkhand
## 0.00000000 0.04472136
## Karnataka Kerala
## 0.08944272 5.92300599
## Madhya Pradesh Maharashtra
## 0.00000000 0.24899799
## Manipur Meghalaya
## 0.13038405 0.00000000
## Mizoram Nagaland
## 0.08944272 0.04472136
## Odisha Punjab
## 0.00000000 0.04472136
## Rajasthan Sikkim
## 0.46043458 0.00000000
## Tamil Nadu Telangana
## 20.47942870 0.40249224
## Tripura Uttar Pradesh
## 0.00000000 0.00000000
## Uttarakhand West Bengal
## 4.88088107 0.00000000
## A&N Islands Chandigarh
## 0.00000000 0.00000000
## D&N Haveli and\nDaman & Diu Delhi
## 0.08944272 0.12247449
## Jammu & Kashmir Lakshadweep
## 0.00000000 0.80436310
## Puducherry Average
## 1.60000000 0.56124861
library(ggplot2)
library(dplyr)
library(ggfortify)
#theme_set(theme_bw())
#autoplot(ndps, ts.colour = 'red', ts.linetype = 'dashed')
autoplot(COTPA_Time_Series_Five_Years, facets = FALSE) +
ggtitle("Time Series Plot of the `COTPA'") + theme(plot.title = element_text(hjust = 0.5)) #for centering the text
## Warning: Removed 80 rows containing missing values (`geom_line()`).