I'm trying to respecify an existing journal for a university assignment which tasks us with replicating the descriptive tables and regressions as similarly to that journal as possible.
My first task is cleaning the data which I've done by removing missing values with this code:
#Feeling under straind$bghqe[d$bghqe < 1] <- NA
#Losing confidenced$bghqj[d$bghqj < 1] <- NA
#Thinking of being a worthless persond$bghqk[d$bghqk < 1] <- NA
#Been less able to enjoy day-to-day activitiesd$bghqg[d$bghqg < 1] <- NA
#Been less able to face up to problemsd$bghqh[d$bghqh < 1] <- NA
#Feeling less happyd$bghql[d$bghql < 1] <- NA
kable(summary(d[,c("bghqe", "bghqj", "bghqk","bghqg","bghqh","bghql")]))
While this doesn't return the exact mean values I need but does get pretty close and I'm planning to do a full na.omit clean on all the variables I need at the end of the cleaning process which will hopefully get the values even closer.
What I need now is to be able to get the percentages which are shown in the rest of the table. Ideally shown as similarly to the table as it is but it isn't a big deal if they're in a different visualisation as long as I can show I got the information out and presented it nicely.
Does anyone have any insight into how to do this?
I've tried using round(100*prop.table code to generate percentages but haven't gotten what I needed because I'm sure I'm not being specific enough but I'm not sure what code to use to help that.