The research design project entails gernerating the data for an experimental study with a control and test group where only the test group would receive treatment. The study will be conducted on clinically depressed patients who will receive newly tested treatment pills to see if symptoms can be alleviated. The control group will receive a placebo pill while the test group will receive the real pills. After a six month trial, the sample will be surveyed on a Likert Scale from 1 - 5 to see if their frequency of mood swing has been lowered and if their overall mental state has been improved.
As the experimental design consists of two independent sample groups – a controlled and experimental group, I will use a parametric test, an unpaired two-samples t-test to compare the means of two independent group’s Likert scale.
Code used to generate responses for control and test group on Likert scale for frequency of mood swings and overall mental state improvement.
Likert Scale: 1 – not recently, 2 – once in the 3 months, 3 – once a month, 4 – once a week, 5 – almost every day
Both groups contain 150 individuals each who ranked frequency of mood swings with predetermined distribution of Likert Scale shown in prob=c().
freq_moodswingsXG = sample(1:5, size=150, replace=TRUE, prob=c(.02,.367,.327,.167,.12))
barplot(table(freq_moodswingsXG))
freq_moodswingsCG = sample(2:5, size=150, replace=TRUE, prob=c(.15,.19,.38,.28))
barplot(table(freq_moodswingsCG))
The code below generates a dataframe by creating a variable that labels which group each scale belongs to then merges the two tables together.
f_moodswingsXG <- cbind(group = "Experimental Group", scale = freq_moodswingsXG)
f_moodswingsCG <- cbind(group = "Control Group", scale = freq_moodswingsCG)
freq_moodswings <- rbind(f_moodswingsXG , f_moodswingsCG)
Indivudals rate if their overall mental state has improved throughout the study on a Likert Scale: 1 – strongly disagree, 2 – disagree, 3 – neutral, 4 – agree, 5 – strongly agree.
Both groups contain 150 individuals each who ranked frequency of mood swings with predetermined distribution of Likert Scale shown in prob=c().
men_stateXG = sample(1:5, size=150, replace=TRUE, prob=c(.01,.1,.16,.42,.31))
barplot(table(men_stateXG))
men_stateCG = sample(1:5, size=150, replace=TRUE, prob=c(.27,.41,.19,.1,.03))
barplot(table(men_stateCG))
The code below generates a dataframe by creating a variable that labels which group each scale belongs to then merges the two tables together.
m_stateXG <- cbind(group = "Experimental Group", scale = men_stateXG)
m_stateCG <- cbind(group = "Control Group", scale = men_stateCG)
men_state <- rbind(m_stateXG, m_stateCG)
Likert Scale: 1 – not recently, 2 – once in the 3 months, 3 – once a month, 4 – once a week, 5 – almost every day
Both groups contain 150 individuals each who ranked frequency of mood swings with predetermined distribution of Likert Scale shown in prob=c().
freq_usageXG = sample(3:5, size=150, replace=TRUE, prob=c(.205,.337,.46))
barplot(table(freq_usageXG))
freq_usageCG = sample(2:5, size=150, replace=TRUE, prob=c(.053,.313,.253,.38))
barplot(table(freq_usageCG))
The code below generates a dataframe by creating a variable that labels which group each scale belongs to then merges the two tables together.
freq_usageXG <- cbind(group = "Experimental Group", scale = freq_usageXG)
freq_usageCG <- cbind(group = "Control Group", scale = freq_usageCG)
freq_usage <- rbind(freq_usageXG, freq_usageCG)
The code below generates a dataframe to distinguish gender in the dataset that evenly distributes both genders into 150.
# Generating male & female data for experimental group & control group
G_XG = sample(c('M', 'F'), 150, replace=TRUE, prob=c(0.5, 0.5))
G_CG = sample(c('M', 'F'), 150, replace=TRUE, prob=c(0.5, 0.5))
# Labeling data for experimental group and control group
G_XG <- cbind(group = "Experimental Group", gender = G_XG)
G_CG <- cbind(group = "Control Group", gender = G_CG)
#Creating dataframe for gender with both groups
gender <- rbind(G_XG, G_CG)
data = read.csv("/Users/loanple/Desktop/Tidy_data.csv")
str(data)
## 'data.frame': 300 obs. of 9 variables:
## $ Respondent : int 1 2 3 4 5 6 7 8 9 10 ...
## $ Group : Factor w/ 2 levels "Control Group",..: 2 2 2 2 2 2 2 2 2 2 ...
## $ Fmswing_Scale : int 4 2 3 2 3 3 2 3 5 3 ...
## $ Fmswing_Meaning : Factor w/ 5 levels "Almost every day",..: 4 5 3 5 3 3 5 3 1 3 ...
## $ Mstate_Scale : int 5 4 4 5 4 4 4 5 4 3 ...
## $ Mstate_Meanning : Factor w/ 5 levels "Extremely good",..: 1 3 3 1 3 3 3 1 3 4 ...
## $ Freq_usage : int 5 5 5 5 3 5 4 5 5 5 ...
## $ Freq_usage_Meaning: Factor w/ 4 levels "Every day","Every few days",..: 1 1 1 1 4 1 2 1 1 1 ...
## $ Gender : Factor w/ 2 levels "F","M": 1 1 2 2 2 1 2 1 2 2 ...
## Control Group Experimental Group
## 2 4
## Control Group Experimental Group
## 4 3
## Control Group Experimental Group
## 4 4
Box Plot for Frequency Mood Swing by Group:
Box Plot for Mental State by Group:
library("ggpubr")
t.test(Fmswing_Scale ~ Group, data=data, var.equal=TRUE)
##
## Two Sample t-test
##
## data: Fmswing_Scale by Group
## t = 8.1849, df = 298, p-value = 8.021e-15
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.7443717 1.2156283
## sample estimates:
## mean in group Control Group mean in group Experimental Group
## 3.946667 2.966667
t.test(Mstate_Scale ~ Group, data=data, var.equal = TRUE)
##
## Two Sample t-test
##
## data: Mstate_Scale by Group
## t = -13.951, df = 298, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.916985 -1.443015
## sample estimates:
## mean in group Control Group mean in group Experimental Group
## 2.186667 3.866667
From the two t-test conducted on the two independent sample groups, there is evidence that shows medical marijuana consumed can positively effect symptoms in clinically depressed individuals by reducing frequency of mood swings, and increasing overall mental state.