Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following model looks at factors that influence the use of prescription medications for anxiety and depression using data from the public use file of
The following model looks at factors that influence the use of prescription medications
for anxiety and depression using data from the public use file of the Canadian
Community Health Survey. The variable MEFDRUG is a binary variable which takes a
value of if the individual took a medication in the past days and otherwise. Table
Table describe the variables.
Table : Variable Descriptions
The following code estimates MEDFDRUG Yes MED DHHSEX,
DHHAGE, GEN SPSDCON, INCGHH,EDUR using the LPM and the pro
bit model and plots the two against DHHAGE age group Comment on the results
and discuss whether you think it is appropriate to use the LPM in this case.
list
# Read in the CCHS data
mydata read.mental
headerTRUE
# Create a subset with the necessary variables and remove any missing observations
train.data subset mydata
mydata$MED &
mydata$MEDFDRUG &
mydata $ DHHSEX &
mydata$DHHGAGE &
mydata$GEN &
mydata$SPSDCON &
mydata $ INCGHH &
mydata$EDUDR
attachtraindata
# Redefine MEDFDRUG instead of
MEDFDRUG MEDFDRUG
# Create a working dataset
mydata data.frame MEDFDRUG
MED factorMED
DHHSEX factor DHHSEX
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started