16.08.2013 Views

An Analysis on Danish Micro Data - School of Economics and ...

An Analysis on Danish Micro Data - School of Economics and ...

An Analysis on Danish Micro Data - School of Economics and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

*c<strong>on</strong>stucti<strong>on</strong> <strong>of</strong> the mean <strong>of</strong> use<strong>of</strong>medicin*/<br />

<strong>Data</strong> use<strong>of</strong>medicin;<br />

set b.finaldata2;<br />

if use<strong>of</strong>medicin ne 0;<br />

if use<strong>of</strong>medicin ne '.';<br />

proc means data=use<strong>of</strong>medicin mean;<br />

var use<strong>of</strong>medicin;<br />

/*putting the values <strong>of</strong> use<strong>of</strong>medicin that are 0 to the mean value<br />

(that is calculated without missings <strong>and</strong> values<br />

<strong>of</strong> zero)*/<br />

if use<strong>of</strong>medicin=0 then do use<strong>of</strong>medicin=860.9862999;<br />

end;<br />

/*putting the missing values <strong>of</strong> use<strong>of</strong>medicin to 0*/<br />

if use<strong>of</strong>medicin='.' then do use<strong>of</strong>medicin=0;<br />

end;<br />

data ud.finaldata2(DROP = Kommk UKbh UFre UKbhamt UFreamt URos<br />

UVestsj UStorstr<br />

UBorn UFyn US<strong>on</strong>jyl URibe UVejle URingk UArhus UViborg UNjyl<br />

emp_1);<br />

set collect;<br />

data test;<br />

set b.finaldata2;<br />

/*creating a c<strong>on</strong>sumpti<strong>on</strong>-variable, c<strong>on</strong>s_antidep, which summarizes<br />

the c<strong>on</strong>sumpti<strong>on</strong> <strong>of</strong> antidepressants the past five years*/<br />

data c<strong>on</strong>sumpti<strong>on</strong>;<br />

set b.finaldata2;<br />

c<strong>on</strong>s_lastyr=lag(antidep);<br />

if (udtrnr NE lag(udtrnr)) then c<strong>on</strong>s_lastyr=0;<br />

c<strong>on</strong>s_2yrsago=lag(c<strong>on</strong>s_lastyr);<br />

if (udtrnr NE lag(udtrnr)) then c<strong>on</strong>s_2yrsago=0;<br />

c<strong>on</strong>s_3yrsago=lag(c<strong>on</strong>s_2yrsago);<br />

if (udtrnr NE lag(udtrnr)) then c<strong>on</strong>s_3yrsago=0;<br />

c<strong>on</strong>s_4yrsago=lag(c<strong>on</strong>s_3yrsago);<br />

if (udtrnr NE lag(udtrnr)) then c<strong>on</strong>s_4yrsago=0;<br />

c<strong>on</strong>s_antidep=antidep+c<strong>on</strong>s_lastyr+c<strong>on</strong>s_2yrsago+c<strong>on</strong>s_3yrsago+c<strong>on</strong>s_4y<br />

rsago;<br />

/*creating a variable indicating how many years out <strong>of</strong> the last 5<br />

years, the pers<strong>on</strong> has taken antidep*/<br />

91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!