To initiate data analysis, the package library(tidyverse) was downloaded.
The pipe that was entered into Rscript to analyse the mean birthweights of twins and singeltons was : frames %>% group_by(plurality)%>% summarise(mean_bw = mean(birthweight)).
This showcased data that indicated, for Twins the mean birthweight was 3248 whereas the mean birthweight for singletons was 2311.
The pipe that was entereed into Rscript to analyse the minimum gestational weights of each ethnic background was: frames %>% group_by(child_ethn) %>% summarise (min_ga = min(gestation_age_w))
This indicated the following gestational ages for each ethnicity:
The group_by function utilises the summary of the data expressed in frames, and then comparmentalises relevant variables into their own columns so that individual functions and calculations can be applied to source the relevant information. In order for this procedure to work, frames %>% needs to be entered first followed by group_by (the variable you need). A summary of the data then looks into the specific category chosen by the group_by function and will analyse the desired measures, such as mean, standard deviation, range and so forth. Computing this procedure may look differently depending on the desired measure, but a standrd structure still follows. For example in the context of trying to uncover the mean of the data, the following structure is used: frame %>% group_by (relevant category) %>% summarise( mean_title = mean(desired variabl)). I found video 9 (2.4.1) the post useful in explaining this concept.xx
The following is a picture of a baby
According to the collected data, for a population of infants, the average birth weight of infants that are twins sits at 3248 g or 3.248kg whereas the average birth weights of singletons is lower sitting at 2311g or 2.311kg. For this same population of infants, the minimum gestational age seems to vary across different ethnic backgrounds. Hispanic (min:37), Aboriginal/Torres Strait Islander (min:33), and East-Asian (min:33) nationalities held the highest minimum gestational age, opposed to African/African American (min:26), Caucasian (min:26), Middle-Eastern (min:28),Polynesian (min:28), South Asian (min:28) and South-East Asian(min:29) ethinicites which all had gestational ages that varied between 26 and 29 weeks.
Attached is the raw data.
A tibble: 2 × 2 plurality mean_bw
A tibble: 10 × 2 child_ethn min_ga
2 African/African-American 26
3 Caucasian 26
4 East Asian 33
5 Hispanic/Latino 37
6 Middle-Eastern 28
7 Missing 36
8 Polynesian/Melanesian 28
9 South Asian 28
10 South-East Asian 29