#packages

library(psych)
#install.packages('epiDisplay')
library(epiDisplay)
## Loading required package: foreign
## Loading required package: survival
## Loading required package: MASS
## Loading required package: nnet
## 
## Attaching package: 'epiDisplay'
## The following objects are masked from 'package:psych':
## 
##     alpha, cs, lookup
library(tidyverse)
## ── Attaching packages
## ───────────────────────────────────────
## tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.0      ✔ purrr   0.3.5 
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.4.1 
## ✔ readr   2.1.2      ✔ forcats 0.5.2 
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ ggplot2::%+%()   masks psych::%+%()
## ✖ ggplot2::alpha() masks epiDisplay::alpha(), psych::alpha()
## ✖ dplyr::filter()  masks stats::filter()
## ✖ dplyr::lag()     masks stats::lag()
## ✖ dplyr::select()  masks MASS::select()
data <-read.csv('/Users/misschelsita/Documents/SYP/CSHIP Data.csv')

#select only females

dataFem<- data[data$gender == '1',]

#female ethnic/racical descriptives - marjoity asaian - hispanic

tab1(dataFem$raceEthnicityOne, sort.group = "decreasing", cum.percent = TRUE)

## dataFem$raceEthnicityOne : 
##         Frequency Percent Cum. percent
## 2             257    40.7         40.7
## 4             237    37.5         78.2
## 5              65    10.3         88.4
## 6              40     6.3         94.8
## 3              32     5.1         99.8
## 1               1     0.2        100.0
##   Total       632   100.0        100.0

#select black & brown females

dataBBFem <-dplyr::filter(dataFem, raceEthnicityOne %in% c("3", "4"))

tab1(dataBBFem$raceEthnicityOne, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$raceEthnicityOne : 
##         Frequency Percent Cum. percent
## 4             237    88.1         88.1
## 3              32    11.9        100.0
##   Total       269   100.0        100.0
tab1(dataBBFem$parentIncGrow, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$parentIncGrow : 
##         Frequency Percent Cum. percent
## 2              52    19.3         19.3
## 4              50    18.6         37.9
## 3              49    18.2         56.1
## 5              36    13.4         69.5
## 1              32    11.9         81.4
## 6              21     7.8         89.2
## 8              15     5.6         94.8
## 7               8     3.0         97.8
## #NULL!          6     2.2        100.0
##   Total       269   100.0        100.0
tab1(dataBBFem$dadEd, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$dadEd : 
##         Frequency Percent Cum. percent
## 1              93    34.6         34.6
## 7              65    24.2         58.7
## 6              56    20.8         79.6
## 2              19     7.1         86.6
## 5              18     6.7         93.3
## 4              17     6.3         99.6
## #NULL!          1     0.4        100.0
##   Total       269   100.0        100.0
tab1(dataBBFem$momUS, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$momUS : 
##         Frequency Percent Cum. percent
## 2             187    69.5         69.5
## 1              77    28.6         98.1
## #NULL!          5     1.9        100.0
##   Total       269   100.0        100.0
tab1(dataBBFem$fatherUS, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$fatherUS : 
##         Frequency Percent Cum. percent
## 2             201    74.7         74.7
## 1              61    22.7         97.4
## #NULL!          7     2.6        100.0
##   Total       269   100.0        100.0
tab1(dataBBFem$year, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$year : 
##         Frequency Percent Cum. percent
## 1             135    50.2         50.2
## 2              58    21.6         71.7
## 3              38    14.1         85.9
## 4              22     8.2         94.1
## 6              10     3.7         97.8
## 5               3     1.1         98.9
## #NULL!          3     1.1        100.0
##   Total       269   100.0        100.0
tab1(dataBBFem$class, sort.group = "decreasing", cum.percent = TRUE)

## dataBBFem$class : 
##         Frequency Percent Cum. percent
## 2             144    53.5         53.5
## 3              75    27.9         81.4
## 1              26     9.7         91.1
## 4              21     7.8         98.9
## 5               2     0.7         99.6
## #NULL!          1     0.4        100.0
##   Total       269   100.0        100.0
#majority working class