⚲
Project
General
Profile
Sign in
Register
Home
Search
:
Understanding Society User Support
All Projects
Understanding Society User Support
Overview
Activity
Issues
Download (1000 Bytes)
Support #1714
» C-19 long format.do
Understanding Society User Support Team
, 06/10/2022 05:01 PM
/*****************************************************************************************
* MERGING INDIVIDUAL FILES ACROSS WAVES INTO LONG FORMAT *
*****************************************************************************************/
clear
// SET WORKING DIRECTORY
cd
"/Users/amwaj-opto/Desktop/COVI19 "
//loop through each wave
foreach
w
in
a
b
c
d
e
f
g
h
i
{
// find the wave number
local
waveno
=
strpos
(
"abcdefghijklmnopqrstuvwxyz"
,
"`w'"
)
// open the individual level file
use
pidp
c
`w'
_age
using
"c`w'_indresp_w"
,
clear
// drop the wave prefix from all variables
rename
c
`w'
_
*
*
// create a wave variable
gen
wave
=
`waveno'
// save one file for each wave
save
tempc
`w'
,
replace
}
// open the file for the first wave (wave a_)
use
tempca
,
clear
// loop through the remaining waves
foreach
w
in
b
c
d
e
f
g
h
i
{
// append the files for the second wave onwards
append
using
tempc
`w'
}
« Previous
1
2
3
Next »
(2-2/3)
Loading...