library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.0.2
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2 v purrr 0.3.4
## v tibble 3.0.4 v dplyr 1.0.2
## v tidyr 1.1.2 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.0
## Warning: package 'tibble' was built under R version 4.0.3
## Warning: package 'tidyr' was built under R version 4.0.2
## Warning: package 'dplyr' was built under R version 4.0.2
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(mosaic)
## Warning: package 'mosaic' was built under R version 4.0.2
## 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 object is masked from 'package:Matrix':
##
## mean
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:purrr':
##
## cross
## 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
library(infer)
## Warning: package 'infer' was built under R version 4.0.2
##
## Attaching package: 'infer'
## The following objects are masked from 'package:mosaic':
##
## prop_test, t_test
library(Hmisc)
## Warning: package 'Hmisc' was built under R version 4.0.3
## Loading required package: survival
## Loading required package: Formula
## Warning: package 'Formula' was built under R version 4.0.3
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following objects are masked from 'package:base':
##
## format.pval, units
library(pastecs)
## Warning: package 'pastecs' was built under R version 4.0.3
##
## Attaching package: 'pastecs'
## The following objects are masked from 'package:dplyr':
##
## first, last
## The following object is masked from 'package:tidyr':
##
## extract
library(gmodels)
## Warning: package 'gmodels' was built under R version 4.0.3
getwd()
## [1] "C:/Users/Jerome/Documents/From_Toshiba_HD_Work_Files/0000_Montgomery_College/Math_217/Final_Project/Working_Folder"
family_z33 <- read_csv("family_z31.csv")
## Warning: Missing column names filled in: 'X1' [1]
##
## -- Column specification --------------------------------------------------------
## cols(
## .default = col_double()
## )
## i Use `spec()` for the full column specifications.
family_z34 <- mutate(family_z33, food_sec = ifelse(FSRUNOUT == 1 | FSLAST == 1 | FSSKIP == 1 | FSBALANC == 1 | FSLESS == 1 | FSHUNGRY == 1 | FSWEIGHT == 1 | FSNOTEAT == 1, 1,0))
write.csv (family_z34, file = "family_z34.csv")
family_z34 <- read_csv("family_z34.csv")
## Warning: Missing column names filled in: 'X1' [1]
## Warning: Duplicated column names deduplicated: 'X1' => 'X1_1' [2]
##
## -- Column specification --------------------------------------------------------
## cols(
## .default = col_double()
## )
## i Use `spec()` for the full column specifications.
table(family_z34$food_sec)
##
## 1
## 330
table(family_z34$FHSTATEX)
##
## 0 1 2 3 4 5 6
## 221 47 30 11 12 5 4
table(family_z34$FHSTATVG)
##
## 0 1 2 3 4 5 6 7
## 215 62 33 11 3 4 1 1
table(family_z34$FHSTATPR)
##
## 0 1 2 3
## 282 41 5 2