-
Notifications
You must be signed in to change notification settings - Fork 0
/
cbdata.sthlp
115 lines (78 loc) · 3.81 KB
/
cbdata.sthlp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{smcl}
{* *! version 0.1 15.12.2021}
{viewerjumpto "Syntax" "cbdata##syntax"}{...}
{viewerjumpto "Description" "cbdata##description"}{...}
{viewerjumpto "Options" "cbdata##options"}{...}
{viewerjumpto "Examples" "cbdata##examples"}{...}
{viewerjumpto "Author" "cbdata##author"}{...}
{title:Title}
{phang}
{bf:cbdata} {hline 2} Prepare data for codebook
{marker syntax}{...}
{title:Syntax}
{p 8 17 2}
{cmdab:cbdata} [{cmd:using} {it:{help filename}}], [{cmdab:ls:path(}{it:string}{cmd:)}
{cmd:lsonly} {cmd:save(}{it:string}{cmd:)} {cmd:replace} {cmd:panel}
{cmdab:lang:uage(}{it:string}{cmd:)}]
{synoptset 17}{...}
{marker cbdata_options}{...}
{synopthdr :options}
{synoptline}
{synopt:{opt ls:path()}}define folder of LimeSurvey survey file(s){p_end}
{synopt:{opt lsonly}}use just LimeSurvey survey file{p_end}
{synopt:{opt save()}}path and name of output file{p_end}
{synopt:{opt replace}}overwrite existing output file{p_end}
{synopt:{opt lang:uage()}}keep selected questionnaire language{p_end}
{synopt:{opt noa:uto()}}suppress autodetection of connected variable names{p_end}
{synopt:{opt var:pre()}}define list of prefixes of connected variable names{p_end}
{synoptline}
{p2colreset}{...}
{marker description}{...}
{title:Description}
{pstd}{cmd:cbdata} creates a dataset that can be used to create a codebook with
{it:{help cbout}}. There are three possibilities of which data source the
dataset can be generated from:{p_end}
{pstd}{p_end}
{p 8 8 2}1. Stata memory or .dta/.xls(x)-file only:{p_end}
{p 12 12 2}Use data in memory or define a {it:{help filename}} with using{p_end}
{pstd}{p_end}
{p 8 8 2}2. LimeSurvey .txt structure file(s):{p_end}
{p 12 12 2}Choose the folder that containts the LS structure files with
{opt ls:path()} and define option {opt lsonly}. Multiple LS files are treated as
parts of a single survey.{p_end}
{pstd}{p_end}
{p 8 8 2}3. Combine Stata memory/.dta/.xls(x) and LimeSurvey .txt structure file:{p_end}
{p 12 12 2}Use data in memory or define a {it:{help filename}} with using and
choose the folder that containts the LS structure files with {opt ls:path()}.
Variables are merged with their names, so they should not be changed.{p_end}
{marker options_cbdata}{...}
{title:Options for cbdata}
{phang}{opt save()}
{phang}{opt replace}
{phang}{opt ls:path()}
{phang}{opt lsonly}
{phang}{opt var:stub} pay attention to order of varstubs -> finds via
regular expressions, shorter forms are in longer varnames -> change order in option
stata trys to find subvars when name of variables around are the same except
the last character and same amount of answers -> auto detect per default -> option NOAUTO:detect
if more subvars than 9 (count switch from 9 - 10), auto detect can't find all, needs to be specified
given stubnames will overwright auto detect and also find variables they are next to each other
{phang}{opt lang:uage()}
{marker examples}{...}
{title:Examples}
{pstd}Overall workflow in combination with {cmd:cbdata} to prepare the data:{p_end}
{phang2}{cmd:. cbdata, lsdata("limesurvey_data")}{p_end}
{pstd}Add additional labels for the matrix and multiple choice variables
or notes:{p_end}
{phang2}{cmd:. replace label "Satisfaction" if variable == "sat"}{p_end}
{phang2}{cmd:. replace note "Not part of final data set" if variable == "ybirth"}{p_end}
{pstd}Use the data set in memory so save stand alone file with german labels:{p_end}
{phang2}{cmd:. cbtex, save(variables.tex) replace german clr(Gray!30)}{p_end}
{marker author}{...}
{title:Author}
{pstd}Stefan Munnes, {browse "mailto:[email protected]":[email protected]},
WZB - Social Science Center Berlin.{p_end}
{pstd}For additional information see
{browse "https://github.com/StefanMunnes/CodebookGenerator":Github.}{p_end}
other-Variables from Stata needs to be named the same + with other in the end
stonly -> if label -> tabulate, otherwise string or numeric