I am trying to reshape variables from long to wide. I first tried:
. reshape wide i(pop_WDI_PW - ri_out_BZ) j(year)
option i() required
long wide
+---------------+ +------------------+
| i j a b | | i a1 a2 b1 b2 |
|---------------| <--- reshape ---> |------------------|
| 1 1 1 2 | | 1 1 3 2 4 |
| 1 2 3 4 | | 2 5 7 6 8 |
| 2 1 5 6 | +------------------+
| 2 2 7 8 |
+---------------+
long to wide: reshape wide a b, i(i) j(j) (j existing variable)
wide to long: reshape long a b, i(i) j(j) (j new variable)
r(198);
. dataex
input statement exceeds linesize limit. Try specifying fewer variables
and then when I tried to make a dataex I wss informed that there were too many variables so that I only selected one variable and still got the same error message:
. reshape wide, i(pop_WDI_PW) j(year)
invalid syntax
In the reshape command that you typed, you omitted the word wide or long, or substituted some other word for it. You should have typed
. reshape wide varlist, ...
or
. reshape long varlist, ...
You might have omitted varlist, too. The basic syntax of reshape is
long wide
+---------------+ +------------------+
| i j a b | | i a1 a2 b1 b2 |
|---------------| <--- reshape ---> |------------------|
| 1 1 1 2 | | 1 1 3 2 4 |
| 1 2 3 4 | | 2 5 7 6 8 |
| 2 1 5 6 | +------------------+
| 2 2 7 8 |
+---------------+
long to wide: reshape wide a b, i(i) j(j) (j existing variable)
wide to long: reshape long a b, i(i) j(j) (j new variable)
r(198);
. dataex
input statement exceeds linesize limit. Try specifying fewer variables
r(1000);
What am I doing wrong? Many thanks for any help.
Ric
Related Posts with reshape issue
how to test residual in "rangestat (reg)"hello teacher and professor I have a question need help when I use "rangestat (reg)' to run each fac…
how to create tempfile named according to value of a local in a loop?Hi! I have 19 files, and want Stata to create a tempfile for each one, but named differently. How m…
Unadjusted confidential interval versus adjusted CIHi all I am currently analysing some lab data from a RCT. The primary outcome is a binary variable …
Nonparametric Linear regressionHello everyone, I have a dataset whose dependent variable is heavily skewed to the left. The indepe…
Percentage change variable for daily dataHello, I am writing my dissertation thesis on the impact of Brexit negotiations on the value of the…
Subscribe to:
Post Comments (Atom)
0 Response to reshape issue
Post a Comment