Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Data Management Question


From   Matt Vivier <[email protected]>
To   [email protected]
Subject   Re: st: Data Management Question
Date   Fri, 17 Jan 2014 11:47:38 -0500

Hi Eric,

Take a look at:
-help reshape-

Best,

Matt Vivier
Data Analyst
Remedy Partners, Inc


On Thu, Jan 16, 2014 at 9:55 PM, SEVIGNY, ERIC <[email protected]> wrote:
>
> I have data of the following form coding state, a unique crash id (stcase), a sequential vehicle number involved in the crash (vehno), and the moving violations assessed (mviolatn). I would like to create a new variable in wide format for each non-unique combination of state, stcase, and vehno. Crash code 80007 is instructive here, where I would like to reshape the data with new variables mvioltn1...mvioltn6 coding each separate infraction. The rest of the shown cases would have mvioltn1 filled in with the indicated value and missing for the remainder. How can I accomplish this data management task?
>
> Thanks,
>
> Eric Sevigny
>
> state   stcase  vehno   mviolatn
> 6       62636   1       0
> 6       62637   1       95
> 6       62638   1       0
> 6       62638   2       0
> 6       62639   1       0
> 6       62640   1       0
> 6       62641   1       0
> 6       62642   1       95
> 8       80001   1       0
> 8       80002   1       4
> 8       80002   2       0
> 8       80003   1       0
> 8       80005   1       0
> 8       80006   1       0
> 8       80007   1       72
> 8       80007   1       92
> 8       80007   1       5
> 8       80007   1       11
> 8       80007   1       22
> 8       80007   1       1
> 8       80008   1       0
> 8       80009   1       0
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

-- 
The information contained in this transmission and any attachments may be 
confidential, proprietary  or privileged, and may be subject to protection 
under applicable law. This transmission is intended for the sole use of the 
individual or  entity to whom it is addressed. If you think you have 
received this transmission in error, please alert 
[email protected] and then delete this e-mail immediately. 
Thank you.

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index