library(haven)
LEC<-read_sav("LEC1C.SYS.MAR0302.sav") 
library(dplyr) 
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
posimpact<-dplyr::select(LEC,ltpi_c1)
library(naniar)
vis_miss(posimpact)
## Warning: `gather_()` was deprecated in tidyr 1.2.0.
## Please use `gather()` instead.

summary(posimpact)
##     ltpi_c1     
##  Min.   : 0.00  
##  1st Qu.: 3.00  
##  Median : 6.00  
##  Mean   : 6.94  
##  3rd Qu.:10.00  
##  Max.   :28.00
mean(posimpact$ltpi_c1)
## [1] 6.939815
median(posimpact$ltpi_c1)
## [1] 6
print(names(table(posimpact$ltpi_c1))[which(table(posimpact$ltpi_c1) == max(table(
  posimpact$ltpi_c1)))])
## [1] "5"
library(stats)
sd(posimpact$ltpi_c1,na.rm=TRUE)
## [1] 5.343206
var(posimpact$ltpi_c1)
## [1] 28.54985
range(posimpact$ltpi_c1)
## [1]  0 28
IQR(posimpact$ltpi_c1)
## [1] 7
hist(posimpact$ltpi_c1)

hist(posimpact$ltpi_c1, #Data graphed
     main="Histogram for Positive Impact Scores", #Title
     xlab="Positive Impact", #X-axis name
     border="black", #Bar border color
     col="red", #Bar color
     xlim=c(0,30), #X-axis limits
     ylim=c(0,100)) #Y-axis limits

library(psych)
skew(posimpact$ltpi_c1, na.rm=TRUE, type=3)
## [1] 0.9861315
kurtosi(posimpact$ltpi_c1, na.rm=TRUE, type=3)
## [1] 0.7884755
sessionInfo()
## R version 4.2.1 (2022-06-23)
## Platform: aarch64-apple-darwin20 (64-bit)
## Running under: macOS Monterey 12.6
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] psych_2.2.5  naniar_0.6.1 dplyr_1.0.10 haven_2.5.1 
## 
## loaded via a namespace (and not attached):
##  [1] highr_0.9        bslib_0.4.0      compiler_4.2.1   pillar_1.8.1    
##  [5] jquerylib_0.1.4  forcats_0.5.2    tools_4.2.1      digest_0.6.29   
##  [9] nlme_3.1-157     lattice_0.20-45  gtable_0.3.1     jsonlite_1.8.0  
## [13] evaluate_0.16    lifecycle_1.0.2  tibble_3.1.8     pkgconfig_2.0.3 
## [17] rlang_1.0.5      cli_3.4.0        DBI_1.1.3        rstudioapi_0.14 
## [21] parallel_4.2.1   yaml_2.3.5       xfun_0.33        fastmap_1.1.0   
## [25] stringr_1.4.1    knitr_1.40       generics_0.1.3   vctrs_0.4.1     
## [29] sass_0.4.2       hms_1.1.2        grid_4.2.1       tidyselect_1.1.2
## [33] glue_1.6.2       R6_2.5.1         fansi_1.0.3      rmarkdown_2.16  
## [37] farver_2.1.1     tidyr_1.2.1      ggplot2_3.3.6    readr_2.1.2     
## [41] tzdb_0.3.0       purrr_0.3.4      magrittr_2.0.3   scales_1.2.1    
## [45] ellipsis_0.3.2   htmltools_0.5.3  mnormt_2.1.0     visdat_0.5.3    
## [49] assertthat_0.2.1 colorspace_2.0-3 labeling_0.4.2   utf8_1.2.2      
## [53] stringi_1.7.8    munsell_0.5.0    cachem_1.0.6
citation("haven")
## 
## To cite package 'haven' in publications use:
## 
##   Wickham H, Miller E, Smith D (2022). _haven: Import and Export
##   'SPSS', 'Stata' and 'SAS' Files_. R package version 2.5.1,
##   <https://CRAN.R-project.org/package=haven>.
## 
## A BibTeX entry for LaTeX users is
## 
##   @Manual{,
##     title = {haven: Import and Export 'SPSS', 'Stata' and 'SAS' Files},
##     author = {Hadley Wickham and Evan Miller and Danny Smith},
##     year = {2022},
##     note = {R package version 2.5.1},
##     url = {https://CRAN.R-project.org/package=haven},
##   }
citation("dplyr")
## 
## To cite package 'dplyr' in publications use:
## 
##   Wickham H, François R, Henry L, Müller K (2022). _dplyr: A Grammar of
##   Data Manipulation_. R package version 1.0.10,
##   <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},
##     year = {2022},
##     note = {R package version 1.0.10},
##     url = {https://CRAN.R-project.org/package=dplyr},
##   }
citation("naniar")
## 
## To cite package 'naniar' in publications use:
## 
##   Tierney N, Cook D, McBain M, Fay C (2021). _naniar: Data Structures,
##   Summaries, and Visualisations for Missing Data_. R package version
##   0.6.1, <https://CRAN.R-project.org/package=naniar>.
## 
## A BibTeX entry for LaTeX users is
## 
##   @Manual{,
##     title = {naniar: Data Structures, Summaries, and Visualisations for Missing Data},
##     author = {Nicholas Tierney and Di Cook and Miles McBain and Colin Fay},
##     year = {2021},
##     note = {R package version 0.6.1},
##     url = {https://CRAN.R-project.org/package=naniar},
##   }
citation("psych")
## 
## To cite the psych package in publications use:
## 
##   Revelle, W. (2022) psych: Procedures for Personality and
##   Psychological Research, Northwestern University, Evanston, Illinois,
##   USA, https://CRAN.R-project.org/package=psych Version = 2.2.5.
## 
## 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 = {2022},
##     note = {R package version 2.2.5},
##     url = {https://CRAN.R-project.org/package=psych},
##   }