Load
Load R
######Libraries#############################
suppressWarnings({
require(Amelia)
require(broom)
require(car)
require(caret)
require(corrplot)
require(dplyr)
require(e1071)
require(fastDummies)
require(ggplot2)
require(ggcorrplot)
require(ggExtra)
require(glmpath)
require(grid)
require(gridExtra)
require(kableExtra)
require(leaflet)
require(leaflet.extras)
require(leaps)
require(maptools)
require(MASS)
require(imbalance)
require(mlpack)
require(neuralnet)
require(psych)
require(raster)
require(RColorBrewer)
require(ResourceSelection)
require(reticulate)
require(rgdal)
require(rgeos)
require(shiny)
require(sf)
require(sjPlot)
require(sp)
require(tidyverse)
})
## Loading required package: Amelia
## Loading required package: Rcpp
## ##
## ## Amelia II: Multiple Imputation
## ## (Version 1.8.1, built: 2022-11-18)
## ## Copyright (C) 2005-2023 James Honaker, Gary King and Matthew Blackwell
## ## Refer to http://gking.harvard.edu/amelia/ for more information
## ##
## Loading required package: broom
## Loading required package: car
## Loading required package: carData
## Loading required package: caret
## Loading required package: ggplot2
## Loading required package: lattice
## Loading required package: corrplot
## corrplot 0.92 loaded
## Loading required package: dplyr
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:car':
##
## recode
## 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: e1071
## Loading required package: fastDummies
## Thank you for using fastDummies!
## To acknowledge our work, please cite the package:
## Kaplan, J. & Schlegel, B. (2023). fastDummies: Fast Creation of Dummy (Binary) Columns and Rows from Categorical Variables. Version 1.7.1. URL: https://github.com/jacobkap/fastDummies, https://jacobkap.github.io/fastDummies/.
## Loading required package: ggcorrplot
## Loading required package: ggExtra
## Loading required package: glmpath
## Loading required package: survival
##
## Attaching package: 'survival'
## The following object is masked from 'package:caret':
##
## cluster
## Loading required package: grid
## Loading required package: gridExtra
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
## Loading required package: kableExtra
##
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
##
## group_rows
## Loading required package: leaflet
## Loading required package: leaflet.extras
## Loading required package: leaps
## Loading required package: maptools
## Loading required package: sp
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, were retired in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## Please note that 'maptools' will be retired during October 2023,
## plan transition at your earliest convenience (see
## https://r-spatial.org/r/2023/05/15/evolution4.html and earlier blogs
## for guidance);some functionality will be moved to 'sp'.
## Checking rgeos availability: TRUE
##
## Attaching package: 'maptools'
## The following object is masked from 'package:car':
##
## pointLabel
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
## Loading required package: imbalance
## Loading required package: mlpack
##
## Attaching package: 'mlpack'
## The following object is masked from 'package:stats':
##
## kmeans
## The following object is masked from 'package:base':
##
## det
## Loading required package: neuralnet
##
## Attaching package: 'neuralnet'
## The following object is masked from 'package:dplyr':
##
## compute
## Loading required package: psych
##
## Attaching package: 'psych'
## The following object is masked from 'package:mlpack':
##
## pca
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
## The following object is masked from 'package:car':
##
## logit
## Loading required package: raster
##
## Attaching package: 'raster'
## The following object is masked from 'package:MASS':
##
## select
## The following object is masked from 'package:dplyr':
##
## select
## Loading required package: RColorBrewer
## Loading required package: ResourceSelection
## ResourceSelection 0.3-6 2023-06-27
## Loading required package: reticulate
## Loading required package: rgdal
## Please note that rgdal will be retired during October 2023,
## plan transition to sf/stars/terra functions using GDAL and PROJ
## at your earliest convenience.
## See https://r-spatial.org/r/2023/05/15/evolution4.html and https://github.com/r-spatial/evolution
## rgdal: version: 1.6-7, (SVN revision 1203)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.6.2, released 2023/01/02
## Path to GDAL shared files: C:/Users/lfult/AppData/Local/R/win-library/4.2/rgdal/gdal
## GDAL does not use iconv for recoding strings.
## GDAL binary built with GEOS: TRUE
## Loaded PROJ runtime: Rel. 9.2.0, March 1st, 2023, [PJ_VERSION: 920]
## Path to PROJ shared files: C:/Users/lfult/AppData/Local/R/win-library/4.2/rgdal/proj
## PROJ CDN enabled: FALSE
## Linking to sp version:2.1-0
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
## Loading required package: rgeos
## rgeos version: 0.6-4, (SVN revision 699)
## GEOS runtime version: 3.11.2-CAPI-1.17.2
## Please note that rgeos will be retired during October 2023,
## plan transition to sf or terra functions using GEOS at your earliest convenience.
## See https://r-spatial.org/r/2023/05/15/evolution4.html for details.
## GEOS using OverlayNG
## Linking to sp version: 2.1-0
## Polygon checking: TRUE
##
## Attaching package: 'rgeos'
## The following object is masked from 'package:dplyr':
##
## symdiff
## Loading required package: shiny
##
## Attaching package: 'shiny'
## The following object is masked from 'package:ggExtra':
##
## runExample
## Loading required package: sf
## Linking to GEOS 3.11.2, GDAL 3.6.2, PROJ 9.2.0; sf_use_s2() is TRUE
## Loading required package: sjPlot
## #refugeeswelcome
## Loading required package: tidyverse
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ lubridate 1.9.3 ✔ tibble 3.2.1
## ✔ purrr 1.0.1 ✔ tidyr 1.3.0
## ✔ readr 2.1.4
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ psych::%+%() masks ggplot2::%+%()
## ✖ psych::alpha() masks ggplot2::alpha()
## ✖ gridExtra::combine() masks dplyr::combine()
## ✖ neuralnet::compute() masks dplyr::compute()
## ✖ tidyr::extract() masks raster::extract()
## ✖ dplyr::filter() masks stats::filter()
## ✖ kableExtra::group_rows() masks dplyr::group_rows()
## ✖ dplyr::lag() masks stats::lag()
## ✖ purrr::lift() masks caret::lift()
## ✖ dplyr::recode() masks car::recode()
## ✖ raster::select() masks MASS::select(), dplyr::select()
## ✖ purrr::some() masks car::some()
## ✖ rgeos::symdiff() masks dplyr::symdiff()
## ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
############################################
Load Python
#Basic Operating System Stuff
import os
import gc #garbage collector
import random #random seed generator
#Basic dataframe, array, and math stuff
import pandas as pd #data frame
import math #math functions
import numpy as np #numerical package
#Scikit learn
from math import sqrt
import sklearn as sk #scikit learn
import sklearn.linear_model
from sklearn.linear_model import LogisticRegression as LR
from sklearn.kernel_ridge import KernelRidge
from sklearn.utils import resample #sampling
from sklearn.model_selection import train_test_split as tts, KFold #train test split
from sklearn.decomposition import PCA #principal components
from sklearn.metrics import classification_report as CR,confusion_matrix, roc_curve
from sklearn.metrics import average_precision_score #for 2-class model
from sklearn.metrics import PrecisionRecallDisplay as PRD
from sklearn.metrics import ConfusionMatrixDisplay as CMD
from sklearn.preprocessing import MinMaxScaler as MMS, StandardScaler as SS, PolynomialFeatures as poly # used for variable scaling data
from sklearn.tree import DecisionTreeClassifier as Tree
from sklearn.ensemble import RandomForestClassifier as RFC, ExtraTreesClassifier as ETC
from sklearn.ensemble import GradientBoostingClassifier as GBC, AdaBoostClassifier as ABC
from sklearn.gaussian_process import GaussianProcessClassifier as GPC
from sklearn.svm import LinearSVC, SVC
from sklearn.linear_model import SGDClassifier as SGD
from sklearn.naive_bayes import BernoulliNB as NB
from sklearn.neighbors import KNeighborsClassifier as KNN
from sklearn.pipeline import make_pipeline
from sklearn.neural_network import MLPClassifier as MLP
from sklearn.linear_model import Perceptron
from sklearn.tree import plot_tree as treeplot, export_graphviz
from scipy import misc, stats as st #Lots of stuff here
from scipy.stats import norm
import itertools
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.genmod import families
import statsmodels.stats.tests.test_influence
import statsmodels.formula.api as smf
import statsmodels.stats.api as sms
import matplotlib.pyplot as plt
from statsmodels.compat import lzip
import statsmodels.api as sm
#Graphing
import seaborn as sns
from IPython.display import SVG #Same here
import matplotlib.pyplot as plt #plotting
import matplotlib #image save
from matplotlib.pyplot import imshow #Show images
from PIL import Image #Another image utility
import seaborn as sns
os.chdir('C:/Users/lfult/Desktop/Breach')
##############################################################################################################################
Load Functions
myprint=function(x){x%>%kbl()%>%kable_classic(html_font = "Cambria")}
mycite=function(x){citation(x)}
Load Geography
setwd("C:/Users/lfult/Desktop/Breach")
myshape=shapefile("cb_2018_us_county_20m.shp") #shape file
Load Flat Files
countydata=read.csv("GIS.csv",fileEncoding="UTF-8-BOM", stringsAsFactors = T)
missmap(countydata, x.cex=.6)

countydata$M=countydata$FIPS
countydata$Pop2020=NULL
countydata$CensusMean=NULL
Merge Files
myshape$M=as.numeric(myshape$GEOID)
counties=sp::merge(myshape, countydata, by="M",all.x=F)
counties=counties[complete.cases(counties@data),]
mydata=counties@data
#write.csv(counties@data,'merged.csv', row.names = FALSE)
missmap(mydata, col=c('red','blue'))

M1:LogReg
suppressWarnings({
myglm=glm(y~.,data=train2, family='binomial')
par(ask=FALSE)
par(mfrow=c(2,3))
})
mysum=summary(myglm)
print(noquote(paste("R^2:",1-myglm$deviance/myglm$null.deviance)))
## [1] R^2: 0.576294974175473
pm1=plot_model(myglm, main="Full Model", show.values=TRUE, show.p=TRUE, value.offset=.4, main='Full Model')
pm1

VIF
mys=summary(myglm)
myvif=noquote(c(NA,vif(myglm)))
names(myvif)='VIF'
newcoefs=cbind(round(mys$coefficients,3), myvif)
newcoefs=round(newcoefs,3)
colnames(newcoefs)=c('LR', 'SE', 'Z', 'P(Z)', 'VIF')
myprint(newcoefs[-1,])
|
|
LR
|
SE
|
Z
|
P(Z)
|
VIF
|
|
Native_P40
|
-0.928
|
0.261
|
-3.556
|
0.000
|
1.391
|
|
Native_P60
|
-0.905
|
0.306
|
-2.958
|
0.003
|
1.256
|
|
Native_P80
|
-1.371
|
0.321
|
-4.277
|
0.000
|
1.248
|
|
Native_P100
|
-1.123
|
0.307
|
-3.656
|
0.000
|
1.417
|
|
Hispanic_P40
|
-0.861
|
0.309
|
-2.787
|
0.005
|
1.434
|
|
Hispanic_P60
|
-1.296
|
0.324
|
-4.000
|
0.000
|
1.614
|
|
Hispanic_P80
|
-1.404
|
0.304
|
-4.614
|
0.000
|
1.772
|
|
Hispanic_P100
|
-2.264
|
0.344
|
-6.577
|
0.000
|
1.990
|
|
Black_P40
|
-1.581
|
0.300
|
-5.262
|
0.000
|
1.418
|
|
Black_P60
|
-2.162
|
0.315
|
-6.856
|
0.000
|
1.626
|
|
Black_P80
|
-1.518
|
0.316
|
-4.808
|
0.000
|
1.931
|
|
Black_P100
|
-1.920
|
0.366
|
-5.248
|
0.000
|
2.425
|
|
Asian_P20
|
-2.142
|
0.387
|
-5.538
|
0.000
|
1.323
|
|
Asian_P40
|
-1.298
|
0.306
|
-4.239
|
0.000
|
1.303
|
|
Asian_P80
|
-1.116
|
0.291
|
-3.832
|
0.000
|
1.547
|
|
Asian_P100
|
-0.278
|
0.306
|
-0.907
|
0.364
|
2.064
|
|
PedTrauma_1
|
0.785
|
0.471
|
1.667
|
0.095
|
1.219
|
|
MedCenter_1
|
0.954
|
0.360
|
2.652
|
0.008
|
1.575
|
|
CapitalExp_P20
|
-0.831
|
0.401
|
-2.074
|
0.038
|
1.432
|
|
CapitalExp_P40
|
-1.262
|
0.343
|
-3.676
|
0.000
|
1.259
|
|
CapitalExp_P80
|
-0.616
|
0.261
|
-2.358
|
0.018
|
1.460
|
|
CapitalExp_P100
|
-0.679
|
0.308
|
-2.204
|
0.028
|
1.988
|
|
Prop65
|
-0.190
|
0.121
|
-1.563
|
0.118
|
1.514
|
|
OpProfitMargin
|
-0.351
|
0.119
|
-2.943
|
0.003
|
1.629
|
|
OpIncome
|
0.145
|
0.122
|
1.193
|
0.233
|
1.610
|
|
AR
|
0.296
|
0.130
|
2.277
|
0.023
|
1.672
|
|
BadDebt
|
0.100
|
0.167
|
0.599
|
0.549
|
2.592
|
|
BedFreqSev
|
1.371
|
0.213
|
6.449
|
0.000
|
3.719
|
|
OutpatientVisits
|
0.252
|
0.170
|
1.480
|
0.139
|
2.470
|
|
ALOS
|
-0.416
|
0.148
|
-2.807
|
0.005
|
2.026
|
|
UE2019
|
-0.175
|
0.123
|
-1.421
|
0.155
|
1.732
|
|
Poverty
|
0.209
|
0.129
|
1.617
|
0.106
|
1.800
|
forexport= newcoefs[2:length(myglm$coefficients),]
Outliers
plot(myglm, which = 4, id.n = 6)

#plot(myglm, which =c(5))
model.data <- augment(myglm) %>% mutate(index = 1:n())
ggplot(model.data, aes(index, .std.resid)) +
geom_point(aes(), alpha = .5) +
theme_bw()

model.data %>%
filter(abs(.std.resid) > 3)
## # A tibble: 6 × 40
## y Native_P40 Native_P60 Native_P80 Native_P100 Hispanic_P40 Hispanic_P60
## <int> <int> <int> <int> <int> <int> <int>
## 1 1 0 0 1 0 1 0
## 2 0 0 0 1 0 1 0
## 3 1 0 1 0 0 0 0
## 4 1 0 0 1 0 0 0
## 5 1 1 0 0 0 0 0
## 6 1 0 0 0 1 0 0
## # ℹ 33 more variables: Hispanic_P80 <int>, Hispanic_P100 <int>,
## # Black_P40 <int>, Black_P60 <int>, Black_P80 <int>, Black_P100 <int>,
## # Asian_P20 <int>, Asian_P40 <int>, Asian_P80 <int>, Asian_P100 <int>,
## # PedTrauma_1 <int>, MedCenter_1 <int>, CapitalExp_P20 <int>,
## # CapitalExp_P40 <int>, CapitalExp_P80 <int>, CapitalExp_P100 <int>,
## # Prop65 <dbl>, OpProfitMargin <dbl>, OpIncome <dbl>, AR <dbl>,
## # BadDebt <dbl>, BedFreqSev <dbl>, OutpatientVisits <dbl>, ALOS <dbl>, …
Outlier Effect
train3=train2[-c(526,556,793,845,858,1314),]
myglm2=glm(y~.,data=train3, family='binomial')
compare=cbind(myglm2$coefficients, myglm$coefficients)
colnames(compare)=c('Without Outliers', 'With Outliers')
myprint(compare)
|
|
Without Outliers
|
With Outliers
|
|
(Intercept)
|
3.2386233
|
3.1436510
|
|
Native_P40
|
-1.0352935
|
-0.9282454
|
|
Native_P60
|
-0.7911568
|
-0.9047416
|
|
Native_P80
|
-1.4869334
|
-1.3712453
|
|
Native_P100
|
-1.1831740
|
-1.1234862
|
|
Hispanic_P40
|
-0.8657349
|
-0.8610440
|
|
Hispanic_P60
|
-1.3384428
|
-1.2958404
|
|
Hispanic_P80
|
-1.4728688
|
-1.4039161
|
|
Hispanic_P100
|
-2.4535927
|
-2.2643513
|
|
Black_P40
|
-1.5778923
|
-1.5809882
|
|
Black_P60
|
-2.2983882
|
-2.1620087
|
|
Black_P80
|
-1.6003539
|
-1.5175757
|
|
Black_P100
|
-1.9423319
|
-1.9196144
|
|
Asian_P20
|
-2.2634797
|
-2.1418128
|
|
Asian_P40
|
-1.3351283
|
-1.2982008
|
|
Asian_P80
|
-1.1545162
|
-1.1163427
|
|
Asian_P100
|
-0.1502029
|
-0.2778906
|
|
PedTrauma_1
|
0.9893849
|
0.7852201
|
|
MedCenter_1
|
1.1084424
|
0.9535528
|
|
CapitalExp_P20
|
-0.8110963
|
-0.8312061
|
|
CapitalExp_P40
|
-1.4022893
|
-1.2615687
|
|
CapitalExp_P80
|
-0.6179319
|
-0.6158547
|
|
CapitalExp_P100
|
-0.6845975
|
-0.6790396
|
|
Prop65
|
-0.1488427
|
-0.1895831
|
|
OpProfitMargin
|
-0.4897787
|
-0.3510113
|
|
OpIncome
|
0.1563753
|
0.1454388
|
|
AR
|
0.3562718
|
0.2956772
|
|
BadDebt
|
0.0754719
|
0.0998081
|
|
BedFreqSev
|
1.3857339
|
1.3706484
|
|
OutpatientVisits
|
0.2692817
|
0.2515908
|
|
ALOS
|
-0.4616862
|
-0.4159372
|
|
UE2019
|
-0.1953127
|
-0.1748229
|
|
Poverty
|
0.2415636
|
0.2086354
|
Linearity LogOdds
probabilities <- predict(myglm, type = "response")
predicted.classes <- ifelse(probabilities > 0.5, "pos", "neg")
# Select only numeric predictors
tempdata <- train2[,-c(1:23)] %>%
dplyr::select_if(is.numeric)
predictors <- colnames(train2)
# Bind the logit and tidying the data for plot
tempdata <- tempdata %>%
mutate(logit = log(probabilities/(1-probabilities))) %>%
gather(key = "predictors", value = "predictor.value", -logit)
ggplot(tempdata, aes(logit, predictor.value))+
geom_point(size = 0.5, alpha = 0.5) +
geom_smooth(method = "loess") +
theme_bw() +
facet_wrap(~predictors, scales = "free_y")
## `geom_smooth()` using formula = 'y ~ x'
## Submodels
dem=train2[,1:17]
work=train2[,c(1,29:31)]
fin=train2[,c(1,25:28)]
type=train2[,c(1,18:19)]
econ=train2[,c(1,32:33)]
sig=train2[,-c(17,24,26,28,30,32,33)]
m1a=glm(y~.,data=dem, family='binomial')
m1b=glm(y~., data=work, family='binomial')
m1c=glm(y~., data=fin, family='binomial')
m1d=glm(y~., data=type, family='binomial')
m1e=glm(y~., data=econ, family='binomial')
m1f=glm(y~., data=sig, family='binomial')
par(mfrow=c(3,2))
pm1=plot_model(m1a, main="Demographics", show.values=TRUE, show.p=TRUE, value.offset=.4)
pm2=plot_model(m1b, main="Workload", show.values=TRUE, show.p=TRUE, value.offset=.4)
pm3=plot_model(m1c, main="Financial", show.values=TRUE, show.p=TRUE, value.offset=.4)
pm4=plot_model(m1d, main="Type", show.values=TRUE, show.p=TRUE, value.offset=.4)
pm5=plot_model(m1e, main="Economic", show.values=TRUE, show.p=TRUE, value.offset=.4)
pm6=plot_model(m1f, main="Significant Variables", show.values=TRUE, show.p=TRUE, value.offset=.4)
pm7=plot_model(myglm, main="Full Model", show.values=TRUE, show.p=TRUE, value.offset=.4)
t1=pm1$data[,c(1,2,5,6)]
t1$Group=rep("1. Demographics", nrow(t1))
t2=pm2$data[,c(1,2,5,6)]
t2$Group=rep("2. Workload", nrow(t2))
t3=pm3$data[,c(1,2,5,6)]
t3$Group=rep("3. Financial", nrow(t3))
t4=pm4$data[,c(1,2,5,6)]
t4$Group=rep("4. Type", nrow(t4))
t5=pm5$data[,c(1,2,5,6)]
t5$Group=rep("5. Economic", nrow(t5))
t6=pm6$data[,c(1,2,5,6)]
t6$Group=rep("6. Significant Only", nrow(t6))
t7=pm7$data[,c(1,2,5,6)]
t7$Group=rep("7. All Variables", nrow(t7))
ttot=rbind(t1,t2,t3,t4,t5,t6,t7)
ttot$Group=as.factor(ttot$Group)
ggplot(data=ttot,
aes(x = term,y = estimate, ymin = .5, ymax = 2.0 ))+
geom_point(aes(col=Group))+
geom_hline(aes(fill=Group),yintercept=1, linetype=2)+
xlab('')+ ylab("Odds Ratio (95% Confidence Interval)")+
geom_errorbar(aes(ymin=conf.low,
ymax=conf.high,col=Group),width=0.5,cex=1)+
facet_grid(~Group)+
theme(plot.title=element_text(size=16,face="bold"),
axis.text.y=element_text(size=8),
axis.text.x=element_text(size=8,face="bold", angle=90),
axis.title=element_text(size=8,face="bold"),
strip.text.y = element_text(hjust=0,vjust = 1,angle=180,face="bold"))+
guides(colour=FALSE)+
coord_flip()
## Warning: `geom_hline()`: Ignoring `mapping` because `yintercept` was provided.
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
## of ggplot2 3.3.4.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Confusion Report
mypred1=as.factor(round(predict(m1a, test, type='response'),0))
mypred2=as.factor(round(predict(m1b, test, type='response'),0))
mypred3=as.factor(round(predict(m1c, test, type='response'),0))
mypred4=as.factor(round(predict(m1d, test, type='response'),0))
mypred5=as.factor(round(predict(m1e, test, type='response'),0))
mypred6=as.factor(round(predict(m1f, test, type='response'),0))
mypred7=as.factor(round(predict(myglm, test, type='response'),0))
mycm1=confusionMatrix(data=mypred1, reference=as.factor(test$y), positive = '1')
mycm2=confusionMatrix(data=mypred2, reference=as.factor(test$y), positive = '1')
mycm3=confusionMatrix(data=mypred3, reference=as.factor(test$y), positive = '1')
mycm4=confusionMatrix(data=mypred4, reference=as.factor(test$y), positive = '1')
mycm5=confusionMatrix(data=mypred5, reference=as.factor(test$y), positive = '1')
mycm6=confusionMatrix(data=mypred6, reference=as.factor(test$y), positive = '1')
mycm7=confusionMatrix(data=mypred7, reference=as.factor(test$y), positive = '1')
met1=rbind(c(mycm1$overall,mycm1$byClass),
c(mycm2$overall,mycm2$byClass),
c(mycm3$overall,mycm3$byClass),
c(mycm4$overall,mycm4$byClass),
c(mycm5$overall,mycm5$byClass),
c(mycm6$overall,mycm6$byClass),
c(mycm7$overall,mycm7$byClass))
mydf=as.data.frame(t(round(met1,3)))
colnames(mydf)=c("Demographics","Workload","Finance","Type","Economics","Significant Only","Full Model")
mydf
## Demographics Workload Finance Type Economics
## Accuracy 0.696 0.705 0.783 0.831 0.324
## Kappa 0.164 0.377 0.457 0.430 0.017
## AccuracyLower 0.628 0.638 0.720 0.773 0.260
## AccuracyUpper 0.758 0.766 0.837 0.879 0.392
## AccuracyNull 0.768 0.768 0.768 0.768 0.768
## AccuracyPValue 0.993 0.985 0.345 0.017 1.000
## McnemarPValue 0.801 0.000 0.017 0.000 0.000
## Sensitivity 0.375 0.833 0.708 0.396 0.875
## Specificity 0.792 0.667 0.805 0.962 0.157
## Pos Pred Value 0.353 0.430 0.523 0.760 0.239
## Neg Pred Value 0.808 0.930 0.901 0.841 0.806
## Precision 0.353 0.430 0.523 0.760 0.239
## Recall 0.375 0.833 0.708 0.396 0.875
## F1 0.364 0.567 0.602 0.521 0.375
## Prevalence 0.232 0.232 0.232 0.232 0.232
## Detection Rate 0.087 0.193 0.164 0.092 0.203
## Detection Prevalence 0.246 0.449 0.314 0.121 0.850
## Balanced Accuracy 0.584 0.750 0.757 0.679 0.516
## Significant Only Full Model
## Accuracy 0.778 0.783
## Kappa 0.376 0.385
## AccuracyLower 0.715 0.720
## AccuracyUpper 0.832 0.837
## AccuracyNull 0.768 0.768
## AccuracyPValue 0.408 0.345
## McnemarPValue 1.000 1.000
## Sensitivity 0.521 0.521
## Specificity 0.855 0.862
## Pos Pred Value 0.521 0.532
## Neg Pred Value 0.855 0.856
## Precision 0.521 0.532
## Recall 0.521 0.521
## F1 0.521 0.526
## Prevalence 0.232 0.232
## Detection Rate 0.121 0.121
## Detection Prevalence 0.232 0.227
## Balanced Accuracy 0.688 0.691
Citations
citation("Amelia")
##
## To cite Amelia in publications use:
##
## James Honaker, Gary King, Matthew Blackwell (2011). Amelia II: A
## Program for Missing Data. Journal of Statistical Software, 45(7),
## 1-47. URL https://www.jstatsoft.org/v45/i07/.
##
## A BibTeX entry for LaTeX users is
##
## @Article{,
## title = {{Amelia II}: A Program for Missing Data},
## author = {James Honaker and Gary King and Matthew Blackwell},
## journal = {Journal of Statistical Software},
## year = {2011},
## volume = {45},
## number = {7},
## pages = {1--47},
## doi = {10.18637/jss.v045.i07},
## }
citation("broom")
##
## To cite package 'broom' in publications use:
##
## Robinson D, Hayes A, Couch S (2023). _broom: Convert Statistical
## Objects into Tidy Tibbles_. R package version 1.0.5,
## <https://CRAN.R-project.org/package=broom>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {broom: Convert Statistical Objects into Tidy Tibbles},
## author = {David Robinson and Alex Hayes and Simon Couch},
## year = {2023},
## note = {R package version 1.0.5},
## url = {https://CRAN.R-project.org/package=broom},
## }
citation("car")
##
## To cite the car package in publications use:
##
## Fox J, Weisberg S (2019). _An R Companion to Applied Regression_,
## Third edition. Sage, Thousand Oaks CA.
## <https://socialsciences.mcmaster.ca/jfox/Books/Companion/>.
##
## A BibTeX entry for LaTeX users is
##
## @Book{,
## title = {An {R} Companion to Applied Regression},
## edition = {Third},
## author = {John Fox and Sanford Weisberg},
## year = {2019},
## publisher = {Sage},
## address = {Thousand Oaks {CA}},
## url = {https://socialsciences.mcmaster.ca/jfox/Books/Companion/},
## }
citation("caret")
##
## To cite caret in publications use:
##
## Kuhn, M. (2008). Building Predictive Models in R Using the caret
## Package. Journal of Statistical Software, 28(5), 1–26.
## https://doi.org/10.18637/jss.v028.i05
##
## A BibTeX entry for LaTeX users is
##
## @Article{,
## title = {Building Predictive Models in R Using the caret Package},
## volume = {28},
## url = {https://www.jstatsoft.org/index.php/jss/article/view/v028i05},
## doi = {10.18637/jss.v028.i05},
## number = {5},
## journal = {Journal of Statistical Software},
## author = {{Kuhn} and {Max}},
## year = {2008},
## pages = {1–26},
## }
citation("corrplot")
##
## To cite corrplot in publications use:
##
## Taiyun Wei and Viliam Simko (2021). R package 'corrplot':
## Visualization of a Correlation Matrix (Version 0.92). Available from
## https://github.com/taiyun/corrplot
##
## A BibTeX entry for LaTeX users is
##
## @Manual{corrplot2021,
## title = {R package 'corrplot': Visualization of a Correlation Matrix},
## author = {Taiyun Wei and Viliam Simko},
## year = {2021},
## note = {(Version 0.92)},
## url = {https://github.com/taiyun/corrplot},
## }
citation("dplyr")
##
## To cite package 'dplyr' in publications use:
##
## Wickham H, François R, Henry L, Müller K, Vaughan D (2023). _dplyr: A
## Grammar of Data Manipulation_. R package version 1.1.1,
## <https://CRAN.R-project.org/package=dplyr>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {dplyr: A Grammar of Data Manipulation},
## author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller and Davis Vaughan},
## year = {2023},
## note = {R package version 1.1.1},
## url = {https://CRAN.R-project.org/package=dplyr},
## }
citation("e1071")
##
## To cite package 'e1071' in publications use:
##
## Meyer D, Dimitriadou E, Hornik K, Weingessel A, Leisch F (2023).
## _e1071: Misc Functions of the Department of Statistics, Probability
## Theory Group (Formerly: E1071), TU Wien_. R package version 1.7-13,
## <https://CRAN.R-project.org/package=e1071>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {e1071: Misc Functions of the Department of Statistics, Probability
## Theory Group (Formerly: E1071), TU Wien},
## author = {David Meyer and Evgenia Dimitriadou and Kurt Hornik and Andreas Weingessel and Friedrich Leisch},
## year = {2023},
## note = {R package version 1.7-13},
## url = {https://CRAN.R-project.org/package=e1071},
## }
citation("fastDummies")
##
## To cite package 'fastDummies' in publications use:
##
## Kaplan J (2023). _fastDummies: Fast Creation of Dummy (Binary)
## Columns and Rows from Categorical Variables_. R package version
## 1.7.3, <https://CRAN.R-project.org/package=fastDummies>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {fastDummies: Fast Creation of Dummy (Binary) Columns and Rows from
## Categorical Variables},
## author = {Jacob Kaplan},
## year = {2023},
## note = {R package version 1.7.3},
## url = {https://CRAN.R-project.org/package=fastDummies},
## }
citation("ggplot2")
##
## To cite ggplot2 in publications, please use
##
## H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
## Springer-Verlag New York, 2016.
##
## A BibTeX entry for LaTeX users is
##
## @Book{,
## author = {Hadley Wickham},
## title = {ggplot2: Elegant Graphics for Data Analysis},
## publisher = {Springer-Verlag New York},
## year = {2016},
## isbn = {978-3-319-24277-4},
## url = {https://ggplot2.tidyverse.org},
## }
citation("ggcorrplot")
##
## To cite package 'ggcorrplot' in publications use:
##
## Kassambara A (2023). _ggcorrplot: Visualization of a Correlation
## Matrix using 'ggplot2'_. R package version 0.1.4.1,
## <https://CRAN.R-project.org/package=ggcorrplot>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {ggcorrplot: Visualization of a Correlation Matrix using 'ggplot2'},
## author = {Alboukadel Kassambara},
## year = {2023},
## note = {R package version 0.1.4.1},
## url = {https://CRAN.R-project.org/package=ggcorrplot},
## }
citation("ggExtra")
##
## To cite package 'ggExtra' in publications use:
##
## Attali D, Baker C (2023). _ggExtra: Add Marginal Histograms to
## 'ggplot2', and More 'ggplot2' Enhancements_. R package version
## 0.10.1, <https://CRAN.R-project.org/package=ggExtra>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {ggExtra: Add Marginal Histograms to 'ggplot2', and More 'ggplot2'
## Enhancements},
## author = {Dean Attali and Christopher Baker},
## year = {2023},
## note = {R package version 0.10.1},
## url = {https://CRAN.R-project.org/package=ggExtra},
## }
citation("glmpath")
##
## To cite package 'glmpath' in publications use:
##
## Park MY, Hastie T (2018). _glmpath: L1 Regularization Path for
## Generalized Linear Models and Cox Proportional Hazards Model_. R
## package version 0.98, <https://CRAN.R-project.org/package=glmpath>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {glmpath: L1 Regularization Path for Generalized Linear Models and Cox
## Proportional Hazards Model},
## author = {Mee Young Park and Trevor Hastie},
## year = {2018},
## note = {R package version 0.98},
## url = {https://CRAN.R-project.org/package=glmpath},
## }
##
## ATTENTION: This citation information has been auto-generated from the
## package DESCRIPTION file and may need manual editing, see
## 'help("citation")'.
citation("grid")
##
## The 'grid' package is part of R. To cite R in publications use:
##
## R Core Team (2023). R: A language and environment for statistical
## computing. R Foundation for Statistical Computing, Vienna, Austria.
## URL https://www.R-project.org/.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {R: A Language and Environment for Statistical Computing},
## author = {{R Core Team}},
## organization = {R Foundation for Statistical Computing},
## address = {Vienna, Austria},
## year = {2023},
## url = {https://www.R-project.org/},
## }
##
## We have invested a lot of time and effort in creating R, please cite it
## when using it for data analysis. See also 'citation("pkgname")' for
## citing R packages.
citation("gridExtra")
##
## To cite package 'gridExtra' in publications use:
##
## Auguie B (2017). _gridExtra: Miscellaneous Functions for "Grid"
## Graphics_. R package version 2.3,
## <https://CRAN.R-project.org/package=gridExtra>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {gridExtra: Miscellaneous Functions for "Grid" Graphics},
## author = {Baptiste Auguie},
## year = {2017},
## note = {R package version 2.3},
## url = {https://CRAN.R-project.org/package=gridExtra},
## }
citation("kableExtra")
##
## To cite package 'kableExtra' in publications use:
##
## Zhu H (2021). _kableExtra: Construct Complex Table with 'kable' and
## Pipe Syntax_. R package version 1.3.4,
## <https://CRAN.R-project.org/package=kableExtra>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {kableExtra: Construct Complex Table with 'kable' and Pipe Syntax},
## author = {Hao Zhu},
## year = {2021},
## note = {R package version 1.3.4},
## url = {https://CRAN.R-project.org/package=kableExtra},
## }
citation("leaflet")
##
## To cite package 'leaflet' in publications use:
##
## Cheng J, Schloerke B, Karambelkar B, Xie Y (2023). _leaflet: Create
## Interactive Web Maps with the JavaScript 'Leaflet' Library_. R
## package version 2.2.0, <https://CRAN.R-project.org/package=leaflet>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet'
## Library},
## author = {Joe Cheng and Barret Schloerke and Bhaskar Karambelkar and Yihui Xie},
## year = {2023},
## note = {R package version 2.2.0},
## url = {https://CRAN.R-project.org/package=leaflet},
## }
citation("leaflet.extras")
##
## To cite package 'leaflet.extras' in publications use:
##
## Karambelkar B, Schloerke B (2018). _leaflet.extras: Extra
## Functionality for 'leaflet' Package_. R package version 1.0.0,
## <https://CRAN.R-project.org/package=leaflet.extras>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {leaflet.extras: Extra Functionality for 'leaflet' Package},
## author = {Bhaskar Karambelkar and Barret Schloerke},
## year = {2018},
## note = {R package version 1.0.0},
## url = {https://CRAN.R-project.org/package=leaflet.extras},
## }
citation("leaps")
##
## To cite package 'leaps' in publications use:
##
## Miller TLboFcbA (2020). _leaps: Regression Subset Selection_. R
## package version 3.1, <https://CRAN.R-project.org/package=leaps>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {leaps: Regression Subset Selection},
## author = {Thomas Lumley based on Fortran code by Alan Miller},
## year = {2020},
## note = {R package version 3.1},
## url = {https://CRAN.R-project.org/package=leaps},
## }
##
## ATTENTION: This citation information has been auto-generated from the
## package DESCRIPTION file and may need manual editing, see
## 'help("citation")'.
citation("maptools")
##
## To cite package 'maptools' in publications use:
##
## Bivand R, Lewin-Koh N (2023). _maptools: Tools for Handling Spatial
## Objects_. R package version 1.1-8,
## <https://CRAN.R-project.org/package=maptools>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {maptools: Tools for Handling Spatial Objects},
## author = {Roger Bivand and Nicholas Lewin-Koh},
## year = {2023},
## note = {R package version 1.1-8},
## url = {https://CRAN.R-project.org/package=maptools},
## }
citation("MASS")
##
## To cite the MASS package in publications use:
##
## Venables, W. N. & Ripley, B. D. (2002) Modern Applied Statistics with
## S. Fourth Edition. Springer, New York. ISBN 0-387-95457-0
##
## A BibTeX entry for LaTeX users is
##
## @Book{,
## title = {Modern Applied Statistics with S},
## author = {W. N. Venables and B. D. Ripley},
## publisher = {Springer},
## edition = {Fourth},
## address = {New York},
## year = {2002},
## note = {ISBN 0-387-95457-0},
## url = {https://www.stats.ox.ac.uk/pub/MASS4/},
## }
citation("imbalance")
##
## To cite package imbalance in publications use:
##
## Cordón I, García S, Fernández A, Herrera F (2018). "Imbalance:
## Oversampling algorithms for imbalanced classification in R",
## Knowledge-Based Systems, volume 161, pages 329-341
##
## A BibTeX entry for LaTeX users is
##
## @Article{,
## title = {Imbalance: Oversampling algorithms for imbalanced classification in R},
## author = {Ignacio Cordón and Salvador García and Alberto Fernández and Francisco Herrera},
## month = {12},
## year = {2018},
## pages = {329-341},
## journal = {Knowledge-Based Systems},
## volume = {161},
## url = {https://doi.org/10.1016/j.knosys.2018.07.035},
## }
citation("mlpack")
##
## To cite package 'mlpack' in publications use:
##
## Singh Parihar Y, Curtin R, Eddelbuettel D, Balamuta J (2023).
## _mlpack: 'Rcpp' Integration for the 'mlpack' Library_. R package
## version 4.2.1, <https://CRAN.R-project.org/package=mlpack>.
##
## Curtin R, Edel M, Shrit O, Agrawal S, Basak S, Balamuta J, Birmingham
## R, Dutt K, Eddelbuettel D, Garg R, Jaiswal S, Kaushik A, Kim S,
## Mukherjee A, Sai N, Sharma N, Parihar Y, Swain R, Sanderson C (2023).
## "mlpack 4: a fast, header-only C++ machine learning library."
## _Journal of Open Source Software_, *8*(82). doi:10.21105/joss.05026
## <https://doi.org/10.21105/joss.05026>.
##
## To see these entries in BibTeX format, use 'print(<citation>,
## bibtex=TRUE)', 'toBibtex(.)', or set
## 'options(citation.bibtex.max=999)'.
citation("neuralnet")
##
## To cite package 'neuralnet' in publications use:
##
## Fritsch S, Guenther F, Wright M (2019). _neuralnet: Training of
## Neural Networks_. R package version 1.44.2,
## <https://CRAN.R-project.org/package=neuralnet>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {neuralnet: Training of Neural Networks},
## author = {Stefan Fritsch and Frauke Guenther and Marvin N. Wright},
## year = {2019},
## note = {R package version 1.44.2},
## url = {https://CRAN.R-project.org/package=neuralnet},
## }
citation("psych")
##
## To cite package 'psych' in publications use:
##
## William Revelle (2023). _psych: Procedures for Psychological,
## Psychometric, and Personality Research_. Northwestern University,
## Evanston, Illinois. R package version 2.3.9,
## <https://CRAN.R-project.org/package=psych>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {psych: Procedures for Psychological, Psychometric, and Personality Research},
## author = {{William Revelle}},
## organization = {Northwestern University},
## address = {Evanston, Illinois},
## year = {2023},
## note = {R package version 2.3.9},
## url = {https://CRAN.R-project.org/package=psych},
## }
citation("raster")
##
## To cite package 'raster' in publications use:
##
## Hijmans R (2023). _raster: Geographic Data Analysis and Modeling_. R
## package version 3.6-26, <https://CRAN.R-project.org/package=raster>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {raster: Geographic Data Analysis and Modeling},
## author = {Robert J. Hijmans},
## year = {2023},
## note = {R package version 3.6-26},
## url = {https://CRAN.R-project.org/package=raster},
## }
citation("RColorBrewer")
##
## To cite package 'RColorBrewer' in publications use:
##
## Neuwirth E (2022). _RColorBrewer: ColorBrewer Palettes_. R package
## version 1.1-3, <https://CRAN.R-project.org/package=RColorBrewer>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {RColorBrewer: ColorBrewer Palettes},
## author = {Erich Neuwirth},
## year = {2022},
## note = {R package version 1.1-3},
## url = {https://CRAN.R-project.org/package=RColorBrewer},
## }
citation("ResourceSelection")
##
## To cite package 'ResourceSelection' in publications use:
##
## Lele SR, Keim JL, Solymos P (2023). _ResourceSelection: Resource
## Selection (Probability) Functions for Use-Availability Data_. R
## package version 0.3-6,
## <https://CRAN.R-project.org/package=ResourceSelection>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {ResourceSelection: Resource Selection (Probability) Functions for Use-Availability
## Data},
## author = {Subhash R. Lele and Jonah L. Keim and Peter Solymos},
## year = {2023},
## note = {R package version 0.3-6},
## url = {https://CRAN.R-project.org/package=ResourceSelection},
## }
citation()
##
## To cite R in publications use:
##
## R Core Team (2023). R: A language and environment for statistical
## computing. R Foundation for Statistical Computing, Vienna, Austria.
## URL https://www.R-project.org/.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {R: A Language and Environment for Statistical Computing},
## author = {{R Core Team}},
## organization = {R Foundation for Statistical Computing},
## address = {Vienna, Austria},
## year = {2023},
## url = {https://www.R-project.org/},
## }
##
## We have invested a lot of time and effort in creating R, please cite it
## when using it for data analysis. See also 'citation("pkgname")' for
## citing R packages.
citation("reticulate")
##
## To cite package 'reticulate' in publications use:
##
## Ushey K, Allaire J, Tang Y (2023). _reticulate: Interface to
## 'Python'_. R package version 1.34.0,
## <https://CRAN.R-project.org/package=reticulate>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {reticulate: Interface to 'Python'},
## author = {Kevin Ushey and JJ Allaire and Yuan Tang},
## year = {2023},
## note = {R package version 1.34.0},
## url = {https://CRAN.R-project.org/package=reticulate},
## }
citation("rgdal")
##
## To cite package 'rgdal' in publications use:
##
## Bivand R, Keitt T, Rowlingson B (2023). _rgdal: Bindings for the
## 'Geospatial' Data Abstraction Library_. R package version 1.6-7,
## <https://CRAN.R-project.org/package=rgdal>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {rgdal: Bindings for the 'Geospatial' Data Abstraction Library},
## author = {Roger Bivand and Tim Keitt and Barry Rowlingson},
## year = {2023},
## note = {R package version 1.6-7},
## url = {https://CRAN.R-project.org/package=rgdal},
## }
citation("rgeos")
##
## To cite package 'rgeos' in publications use:
##
## Bivand R, Rundel C (2023). _rgeos: Interface to Geometry Engine -
## Open Source ('GEOS')_. R package version 0.6-4,
## <https://CRAN.R-project.org/package=rgeos>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {rgeos: Interface to Geometry Engine - Open Source ('GEOS')},
## author = {Roger Bivand and Colin Rundel},
## year = {2023},
## note = {R package version 0.6-4},
## url = {https://CRAN.R-project.org/package=rgeos},
## }
citation("shiny")
##
## To cite package 'shiny' in publications use:
##
## Chang W, Cheng J, Allaire J, Sievert C, Schloerke B, Xie Y, Allen J,
## McPherson J, Dipert A, Borges B (2023). _shiny: Web Application
## Framework for R_. R package version 1.7.5.1,
## <https://CRAN.R-project.org/package=shiny>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {shiny: Web Application Framework for R},
## author = {Winston Chang and Joe Cheng and JJ Allaire and Carson Sievert and Barret Schloerke and Yihui Xie and Jeff Allen and Jonathan McPherson and Alan Dipert and Barbara Borges},
## year = {2023},
## note = {R package version 1.7.5.1},
## url = {https://CRAN.R-project.org/package=shiny},
## }
citation("sf")
##
## To cite package sf in publications, please use:
##
## Pebesma, E., & Bivand, R. (2023). Spatial Data Science: With
## Applications in R. Chapman and Hall/CRC.
## https://doi.org/10.1201/9780429459016
##
## Pebesma, E., 2018. Simple Features for R: Standardized Support for
## Spatial Vector Data. The R Journal 10 (1), 439-446,
## https://doi.org/10.32614/RJ-2018-009
##
## To see these entries in BibTeX format, use 'print(<citation>,
## bibtex=TRUE)', 'toBibtex(.)', or set
## 'options(citation.bibtex.max=999)'.
citation("sjPlot")
##
## To cite package 'sjPlot' in publications use:
##
## Lüdecke D (2023). _sjPlot: Data Visualization for Statistics in
## Social Science_. R package version 2.8.15,
## <https://CRAN.R-project.org/package=sjPlot>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {sjPlot: Data Visualization for Statistics in Social Science},
## author = {Daniel Lüdecke},
## year = {2023},
## note = {R package version 2.8.15},
## url = {https://CRAN.R-project.org/package=sjPlot},
## }
citation("sp")
##
## To cite package sp in publications use:
##
## Pebesma E, Bivand R (2005). "Classes and methods for spatial data in
## R." _R News_, *5*(2), 9-13. <https://CRAN.R-project.org/doc/Rnews/>.
##
## Bivand R, Pebesma E, Gomez-Rubio V (2013). _Applied spatial data
## analysis with R, Second edition_. Springer, NY.
## <https://asdar-book.org/>.
##
## To see these entries in BibTeX format, use 'print(<citation>,
## bibtex=TRUE)', 'toBibtex(.)', or set
## 'options(citation.bibtex.max=999)'.
citation("tidyverse")
##
## To cite package 'tidyverse' in publications use:
##
## Wickham H, Averick M, Bryan J, Chang W, McGowan LD, François R,
## Grolemund G, Hayes A, Henry L, Hester J, Kuhn M, Pedersen TL, Miller
## E, Bache SM, Müller K, Ooms J, Robinson D, Seidel DP, Spinu V,
## Takahashi K, Vaughan D, Wilke C, Woo K, Yutani H (2019). "Welcome to
## the tidyverse." _Journal of Open Source Software_, *4*(43), 1686.
## doi:10.21105/joss.01686 <https://doi.org/10.21105/joss.01686>.
##
## A BibTeX entry for LaTeX users is
##
## @Article{,
## title = {Welcome to the {tidyverse}},
## author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani},
## year = {2019},
## journal = {Journal of Open Source Software},
## volume = {4},
## number = {43},
## pages = {1686},
## doi = {10.21105/joss.01686},
## }