[Rd] Re: desiderata for data manipulation
A.J. Rossini
rossini@blindglobe.net
01 Nov 2000 07:47:21 -0800
>>>>> "PDB" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:
PDB> ben@zoo.ufl.edu writes:
>> What does Stata do in this case? I suppose you could generate
>> an error, or give the user the choice to duplicate Y1/assume Y1
>> was the first or last case and put in NAs for the others.
>> From the help file Tony sent, I would assume that it keeps
>> reshaping
PDB> information around, since you can just say "reshape wide". If
PDB> you start with data in the long format, I'm not quite sure
PDB> what it does.
PDB> If you assume that the variable to "unreshape" on is of the
PDB> form
PDB> 1 2 ... n 1 2 ... n 1 2 ... n ...
PDB> and that everything except the response variables is constant
PDB> within blocks, then things are reasonably simple, I suppose.
I'll have to check, but I think it repeats the first value.
Thanks for the pointer to stack/unstack -- now, having been reminded,
I think I'd seen these float through on the list (still doesn't solve
the missing modeling routines (parametric GLMMs, some of the
econometrics stuff -- does R _easily_ do 3SLS?), but they'll appear
sometime, I assume).
One more interesting point -- Stata only has the equivalent of one
data frame (and is optimized for that, another reason for smaller
footprint for stata objects than R; makes some sense if you are only
analysing data in a traditional manner, but increases thought-required
(and need for tricks) for things like (multiple) imputation and
bootstrapping, if you want to reuse generated data from multiple sets.
This also means that the reshape command does interesting things to
your (single) data set structure, since it changes the number of
observations while preserving information for returning to the initial
state.
best,
-tony
--
A.J. Rossini Rsrch. Asst. Prof. of Biostatistics
BlindGlobe Networks (home/default) rossini@blindglobe.net
UW Biostat/Center for AIDS Research rossini@u.washington.edu
FHCRC/SCHARP/HIV Vaccine Trials Net rossini@scharp.org
FHCRC: M/Tu: 206-667-7025 (fax=4812) | Voicemail is pretty sketchy
CFAR: W/F: 206-731-3647 (fax=3694) | Email is far better than phone
UW: Th/F: 206-543-1044 (fax=3286) | Change last 4 digits of phone for fax
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._