Answered step by step
Verified Expert Solution
Link Copied!

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 2012 Canadian
Community Health Survey. The variable MEFDRUG is a binary variable which takes a
value of 1 if the individual took a medication in the past 2 days and 0 otherwise. Table
Table 1 describe the variables.
Table 1: Variable Descriptions
The following R code estimates P(MEDFDRUG = Yes | MED_05, DHH_SEX,
DHHAGE, GEN_01, SPSDCON, INCGHH,EDUR04) 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.
rm( list =1s())
# Read in the CCHS data
mydata - read.csv(cchs-82M0013-E-2012-mental-healthF1.csv,
header=TRUE)
# Create a subset with the necessary variables and remove any missing observations
train.data - subset (mydata,
mydata$MED_05=2 &
mydata$MEDFDRUG 2 &
mydata $ DHH_SEX 2 &
mydata$DHHGAGE =14 &
mydata$GEN_01=5 &
mydata$SPSDCON 40 &
mydata $ INCGHH 5 &
mydata$EDUDR04=4)
attach(train.data)
# Redefine MEDFDRUG ={0,1} instead of {1,2}
MEDFDRUG [MEDFDRUG ==2
# Create a working dataset
mydata - data.frame (MEDFDRUG,
MED_05= factor(MED_05),
DHH_SEX = factor DHH_SEX ?-
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

5. Give some examples of hidden knowledge.

Answered: 1 week ago

Question

Electric resistance in our skin is lowered when our skin is

Answered: 1 week ago

Question

What is electric dipole explain with example

Answered: 1 week ago