library(ggplot2)
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
rawlink <- 'https://raw.githubusercontent.com/renidak01/FinalProject/main/NeuroCog.csv'
neuro <- read.csv(rawlink)
neurosum <- summary(neuro)
neurosum
## X Dx Speed Attention
## Min. : 14.00 Length:242 Min. :-1.00 Min. : 1.00
## 1st Qu.: 81.25 Class :character 1st Qu.:33.00 1st Qu.:32.00
## Median :142.50 Mode :character Median :41.00 Median :41.00
## Mean :140.42 Mean :40.31 Mean :39.75
## 3rd Qu.:202.75 3rd Qu.:48.75 3rd Qu.:50.00
## Max. :263.00 Max. :74.00 Max. :67.00
## Memory Verbal Visual ProbSolv
## Min. : 3.00 Min. :20.00 Min. :12.00 Min. :29.00
## 1st Qu.:36.00 1st Qu.:33.00 1st Qu.:29.00 1st Qu.:39.00
## Median :44.00 Median :40.00 Median :38.00 Median :45.00
## Mean :42.44 Mean :41.37 Mean :37.12 Mean :45.83
## 3rd Qu.:51.00 3rd Qu.:48.00 3rd Qu.:44.00 3rd Qu.:52.00
## Max. :71.00 Max. :78.00 Max. :65.00 Max. :65.00
## SocialCog Age Sex
## Min. :10.00 Min. :18.00 Length:242
## 1st Qu.:34.00 1st Qu.:32.00 Class :character
## Median :44.00 Median :40.00 Mode :character
## Mean :43.93 Mean :40.89
## 3rd Qu.:53.00 3rd Qu.:50.00
## Max. :72.00 Max. :66.00
Here we can see varying scores as measures for differing neurocognitive abilities among the participants in this study. This study observed a control group, a schizophrenic group, and a schizoaffective group. Schizoaffective disorder includes schizophrenia as a symptom, but is also characterized by affective disorders such as mood disorders and mania, hence why it is in its own category. Because of that, I would expect the control group to have the highest scores for cognition, and the schizoaffective group to have the lowest. When looking at a summary of the collected data, the three groups are combined. We can see that collectively, the minimum, 1st quartile, median, mean, 3rd quartile, and maximum values, all differ for each variable which was observed in this study. For example, when scores for social cognition are compared to scores for attention, we can see that social cognition has a maximum value of 72, whereas attention has a maximum value of 67. In order to better compare the cognitive abilities of the three groups, and distinguish any differences to effectively reach a conclusion, I will separate the results for each of the groups. This will allow us to better understand how the three groups are different from one another.
neuro %>%
group_by(Dx)%>%
summarize('Mean Speed'= mean(Speed),
'Mean Attention' = mean(Attention),
'Mean Memory' = mean(Memory))
## # A tibble: 3 × 4
## Dx `Mean Speed` `Mean Attention` `Mean Memory`
## <chr> <dbl> <dbl> <dbl>
## 1 Control 45.1 43.7 45.7
## 2 Schizoaffective 33.2 34.6 38.1
## 3 Schizophrenia 33.1 33.4 37.3
I have separated the results between the control group, the schizoaffective group, and the schizophrenic group so that they are easier to compare. I then selected three of the variables which I would like to work with for this dataset: speed, attention, and memory. For the purposes of this project, I decided to compare the means of each of these variables across the three groups since we will also be visualizing them. As based on the data, I would conclude that the control group had the highest mean speed, attention, and memory scores. Despite my previously stated hypothesis, the schizoaffective group did not have the lowest scores for the values which I have selected! When compared to the schizophrenic group, the schizoaffective group performed better in terms of speed, attention, and memory. We can now visualize these variables!
library(ggplot2)
neurofac <- as.factor(neuro$Dx)
plot(x=neurofac,y=neuro$Speed)
Attention<-neuro$Attention
hist(Attention)
Memory <- neuro$Memory
Groups <- neurofac
plot(x=Memory,y=Groups)
To conclude, when analyzing the neurocog dataset in R for a smaller subset of data which looked at attention, memory, and speed, I found that the control group had the highest performance for all of the variables which I selected. Furthermore, the schizoaffective group outperformed the schizophrenic group for each of the three variables. For the purpose of this project, I only selected a few of the variables to work with, however, when considering the number of variables which were originally observed in the study, it may be possible that the results vary. As I was working on this project, I noticed, for example, the schizophrenic group outperformed the schizoaffective group when looking at problem solving. Getting a look at the bigger picture would be more effective with distinguishing the differences between these two groups, especially when determining whether their differences are truly significant.