Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Data manipulation question


From   [email protected]
To   [email protected]
Subject   Re: st: Data manipulation question
Date   Wed, 28 Jul 2004 17:16:38 -0500

The thing is, I don't have entries in my excel file for those 'ccode' with a
weight of 0(zero)

I have weights for only about 35 out of 182, so I am asking how to generate the
remaining 147 without manually having to figure out which 'ccode's are missing
and entering them manually.

So if I simply -insheet- and -sort-, I will end up with my original file:
ccode   weight
6               .33
10            .036
11            .005
 181           .004
 182           1

I don't know if this makes more sense now or not.  But is there a way to find
out what numbers of the sequence 1-182 are missing?  This is what I am getting
at.

Thanks
Justin


Quoting Clive Nicholas <[email protected]>:

> Justin Dubas wrote:
> 
> > I have an excel file that looks something like this:
> > ccode   weight
> > 6               .33
> > 10            .036
> > 11            .005
> > 181           .004
> > 182           1
> >
> > What I need to do is have ccode from 1 to 182, and weight to be 0(zero) if
> > there
> > is not already a value in my excel file.  So, I hope to have something
> > like
> > this in the end:
> >
> > ccode   weight
> > 1          0.00
> > 2          0.00
> > etc.
> > 6          .33
> > 7          0.00
> > etc.
> > 182         1
> >
> > Any suggestion?
> 
> Unless I've missed something, it looks like a simple -insheet- and -sort-
> job to me; thus:
> 
> . insheet using file.csv
> 
> assuming that your Excel file is ready for conversion, and all the
> information on weights are correct for each case. Then
> 
> . sort ccode
> 
> I hope that helps.
> 
> CLIVE NICHOLAS        |t: 0(044)191 222 5969
> Politics              |e: [email protected]
> Newcastle University  |http://www.ncl.ac.uk/geps
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index