So, I haven't worked with this large of a data set before (about 550 data entries) so things can get confusing. The script I am working with is rather long as it binds our "Pre" and "Post" data from participant questionnaires using the DASS scale.
In terms of merging data frames, summarizing, and interpreting the data, the script is working well. But, I need to update a PowerPoint with a bar graph also, not just the data frames and summaries.
I tried to use the native R function to make a bar graph, but things got messy and it kept saying that I could not subset data. So, instead I'm going to try to use ggplot. I'm not sure if it is easier or not as I am still running into problems.
My code looks like this:
ggplot(ChildALL, aes(x=Pre, Post, y=4:50))+geom_bar(stat="mean")+labs(x="Measure")
What I want to do is make a bar graph with both "Pre" and "Post" times on it (next to each other, probably in different colors). The y will be the average and the x will be three sets of data: Anxiety, Depression, and Stress all based on the already subscaled data from the questionnaire. I'm not sure if I can share the data with you as it is on a private server and contains identifying information, so some general advice would be helpful.
The error I am getting is "can't find a stat called mean". Which, ok it might need to be specified differently but I'm kind of stuck at this point and I may just go back to the native R barplot function since I was at least getting somewhere with that.
Other information that might help: the questionnaire is 68 items long. They are already grouped for their respective subscales and there are additional columns not being used in the graph such as "StartdateC", "familySIDC", and anything specifying male or female. The code for those names are here:
names(ChildALL) <- c("startdateC","familySIDC",
"SCAREDC1","SCAREDC2", "SCAREDC3", "SCAREDC4", "SCAREDC5",
"SCAREDC6","SCAREDC7", "SCAREDC8", "SCAREDC9", "SCAREDC10",
"SCAREDC11","SCAREDC12","SCAREDC13","SCAREDC14","SCAREDC15",
"SCAREDC16","SCAREDC17","SCAREDC18","SCAREDC19","SCAREDC20",
"SCAREDC21","SCAREDC22","SCAREDC23","SCAREDC24","SCAREDC25",
"SCAREDC26","SCAREDC27","SCAREDC28","SCAREDC29","SCAREDC30",
"SCAREDC31","SCAREDC32","SCAREDC33","SCAREDC34","SCAREDC35",
"SCAREDC36","SCAREDC37","SCAREDC38","SCAREDC39","SCAREDC40",
"SCAREDC41",
"CDIC1", "CDIC2", "CDIC3", "CDIC4", "CDIC5", "CDIC6", "CDIC7",
"CDIC8", "CDIC9", "CDIC10","CDIC11","CDIC12","CDIC13","CDIC14",
"CDIC15","CDIC16","CDIC17","CDIC18","CDIC19","CDIC20","CDIC21",
"CDIC22","CDIC23","CDIC24","CDIC25","CDIC26","CDIC27",
"Gender",
"FemalePDS1","FemalePDS2","FemalePDS3","FemalePDS4","FemalePDS5",
"FemalePDS6","FemalePDS7","FemalePDS8","FemalePDS9","FemalePDS10",
"MalePDS1","MalePDS2","MalePDS3","MalePDS4","MalePDS5",
"MalePDS6","MalePDS7","MalePDS8","time")
Hope some advice can come out of it. I think I can build this barplot if I play around with it long enough, but I just wanted to see what other people thought.
Thank you ahead of time.
EDIT: A previous graph a former colleague made:
I'm not sure if he made in R or not as he left without discussing this issue with me. It could very well be that he used Excel or something and I'm wasting my time.