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
Correcting the condition for the creation of a new variable based on a duration since an initial assessementHello All, I hope this message finds you well! I have longitudinal unbalanced data and I am trying…
Adding sum of coefficients to output tableDear all, I am estimating an equation of the form: xtreg y x1 i.year#x1 i.year, fe cluster(country)…
Panel Data AnalysisI currently have a dataset regarding the auctions of spectrum in different countries over the years.…
Percentage change variable for daily dataHello, I am writing my dissertation thesis on the impact of Brexit negotiations on the value of the…
Factor variable notation: How to omit the base period in event study?Hello everybody, I am trying to run an event study model, i.e. I want seperate coefficients of a co…
Subscribe to:
Post Comments (Atom)
0 Response to reshape issue
Post a Comment