subj <- read_excel("C:\\Users\\Grace Gallagher\\Documents\\PEP809A\\subjects.xlsx", sheet = "Demographics")
names(subj)
## [1] "id" "age" "sex" "site" "enroll_date"
## [6] "drug" "dose_mg"
nrow(subj)
## [1] 40
This is showing the proper column names and correct number of rows is imported from opening the Demographics sheet in the Subjects Excel document, and provides the n value.
mean(subj$age)
## [1] 50.125
sd(subj$age)
## [1] 20.10382
min(subj$age)
## [1] 18
median(subj$age)
## [1] 51
max(subj$age)
## [1] 79
This is the statistical analysis of the age of the subjects in the dataset.
mean(subj$dose_mg)
## [1] 19.75
sd(subj$dose_mg)
## [1] 14.36475
min(subj$dose_mg)
## [1] 5
median(subj$dose_mg)
## [1] 15
max(subj$dose_mg)
## [1] 40
This is the statistical analysis of the dose given to subjects in milligrams.
It can be interpreted by the data that the average age of the subjects was around 50 years old. The data also shows the average dose taken by the subjects was 19.75 mg.