Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Reshape Long r(101) Error


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Reshape Long r(101) Error
Date   Mon, 20 Feb 2012 01:44:33 +0000

This works:

set obs 10
gen id = _n
gen j1_q1 = ceil(10 * runiform())
gen j1_q2 = ceil(10 * runiform())
gen j2_q1 = ceil(10 * runiform())
gen j2_q2 = ceil(10 * runiform())
reshape long @_q1 @_q2, i(id) j(judgeid) string

On the face of it yours is just bigger.

Is Stata telling you nothing about the error message? Have you tested

. isid id

Nick

On Sun, Feb 19, 2012 at 7:29 PM,  <Rebecca.Gill@unlv.edu> wrote:
>
> I have a database taken from an online survey in why in which attorneys rate judges on a number of questions. The database is currently in VERY wide form, with one observation for each attorney response and about 900 variables representing about 15 questions per judge. I would like for these to be at the judge level, such that each entry is a single attorney's ratings on 15 questions for a single judge (plus a handful of attorney-level variables, which will not be transposed).
>
> I have renamed all 900+ variables such that the prefix is jXX representing each judge and the endings of the variables are _qXX representing the questions. I have attempted the following reshape command:
>
> reshape long @_q1 @_q2 [etc], i(id) j(judgeid) string
>
> I get an r(101) error saying "long not allowed" but I'm pretty sure that long is supposed to be allowed. Am I missing something here?
>
> To be thorough, here's the exact command I used:
>
> reshape long @_q1a @_q1b @_q2 @_q3a @_q4 @_q5 @_q6 @_q7 @_q8 @_q9 @_q10 @_q11a @_q11b @_q12 @_q13 @_q14 @_ret, i(id) j(judgeid) string
>
> I am using Stata/SE 11.2, and I've confirmed that it has been updated.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index