*! version 1.3 16 Jan 2024
help for comp2longversion 1.3 (15 Jan 2024)

comp2long

Title

comp2long -- reshape NEPS competency data from wide to long

Syntax

comp2long
filename
[, clear save replace harmonize onlyharmonized dropsingle verbose ignore]

options

clear allows you to clear dataset in memory

save(string) save data to desired filepath and filename

replace(string) overwriting former saved file

harmonize keeps only harmonized variables

onlyharmonized renames repeated items to same variable name

dropsingle option is obsolete: single-items are not being harmonized anymore

ignore ignores misspecified items

verbose shows more detail during process

Description

comp2long reshapes NEPS competency data from wide format to long format and automatically sorts variables to the waves in which data was collected.

NEPS competency data is stored in wide-format but survey data in pTarget-datasets is stored in long format. The different ways data is stored in competency data and survey data inevitably leads to data management issues users have to solve before data can by used in a combined dataset. This tool should reduce the amount of work and time users have to invest to achieve this goal.

clear specifies that it is okay to replace the data in memory, even though the current data have not been saved to disk.

replace overwrite existing reshaped competency dataset.

If option replace is specified, a former saved file will be overwritten.

save stores data to a desired filepath and filename.

If option replace is specified, a former saved file will be overwritten.

harmonize renames the repeated scored items so they share the same variable name.

The new variable name consists of the variable name's root, followed by the suffix "_ha", e.g. variable scg9_sc1 and variable scg11_sc1 will share the variable name sc_sc1_ha. The label of the variable tells you if a variable was harmonized. Single items will be just sorted into the proper wave.

onlyharmonized keeps only harmonized scored variables (single items will be dropped). onlyharmonized triggers the option harmonize, when harmonize is not chosen.

dropsingle dropsingle is obsolete; to drop single items simply choose option onlyharmonized to keep only scored items; harmonization of single items is no longer supported;

ignore is forcing the process to go on even there are some misspecified items which can't be harmonized. This misspecification occurs when wave_w*-variables were calculated incorrectly. In this case please contact fdz@lifbi.de for further help!

verbose shows you some of the magic that happens during the process.

Remarks

This command is part of the NEPStools bundle, written to assist with the NEPS dataset files.

The source code of the program is licensed under the GNU General Public License version 3 or later. The corresponding license text can be found on the internet at http://www.gnu.org/licenses/ or in gnugpl.

Examples

reshapes competency data from wide to long without saving data doi:10.5157/NEPS:SC4:12.0.0:

. comp2long "C:/NEPS/SC4/12-0-0/SC4_xTargetCompetencies_D_12-0-0.dta"

reshapes competency data from wide to long without saving data and clears existing dataset in memory doi:10.5157/NEPS:SC4:12.0.0:

. comp2long "C:/NEPS/SC4/12-0-0/SC4_xTargetCompetencies_D_12-0-0.dta", clear

reshapes competency data from wide to long, saving and replacing data doi:10.5157/NEPS:SC4:12.0.0:

. comp2long "C:/NEPS/SC4/12-0-0/SC4_xTargetCompetencies_D_12-0-0.dta", save("Y:/NEPS_workingdata/SC4/pTargetCompetencies.dta") replace

reshapes competency data from wide to long, saving and replacing data and harmonizes variable names of scored items doi:10.5157/NEPS:SC4:12.0.0:

. comp2long "C:/NEPS/SC4/12-0-0/SC4_xTargetCompetencies_D_12-0-0.dta", save("Y:/NEPS_workingdata/SC4/pTargetCompetencies.dta") replace harmonize

reshapes competency data from wide to long, saving and replacing data, harmonizes variable names of scored items and keeps only scored harmonized variables doi:10.5157/NEPS:SC4:12.0.0:

. comp2long "C:/NEPS/SC4/12-0-0/SC4_xTargetCompetencies_D_12-0-0.dta", save("Y:/NEPS_workingdata/SC4/pTargetCompetencies.dta") replace harmonize onlyharmonized

Limitations

use comp2long before you use nepsmiss, otherwise this tool will crash!

This syntax will crash if the same number of cases with wave_wX==0 occurs in two or more wave_wX-variables (e.g. wave_w1 and wave_w4 have equal numbers of non-participating individuals). This is VERY unlikely but yet possible!

We cannot guarantee that it is usefull to treat all harmonized variables as longitudinal variables.

Author

Dietmar Angerer (dietmar.angerer@lifbi.de), Leibniz Institute for Educational Trajectories, Germany.

Also see

Help: NEPStools, merge, append