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

Re: st: L-statistic


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: st: L-statistic
Date   Thu, 24 Apr 2003 18:17:22 +0100

Joseph Coveney wrote:


I don't know how much illumination the following provides, but I have the second edition and it has two examples of the L-statistic, one in using "Artificial data-1" (Table 5.10 on Page 162) and the other using "Determination of the ESR" (Table 5.15 on Page 181). Analysis of the latter dataset does produce an anomaly that Nick describes.
< snip >

--------------------------------------------------------------------------------

clear
set more off
tempfile tmp
insheet using "Determination of the ESR.dat"
replace v1 = subinstr(subinstr(v1, "  ", " ", .), " ", ",", .)
outsheet using `tmp', comma nonames noquote
insheet using `tmp', comma names clear
erase `tmp'
< snip >

Thanks very much for looking at this so thoroughly.

There is a side issue here which I will comment on briefly.

Joseph's early trickery (code above) reflects the fact that the raw data file looks like this:

--------------------------------- start of file
individual fib glob y

1 2.52 38 0
2 2.56 31 0
3 2.19 33 0
4 2.18 31 0
5 3.41 37 0
6 2.46 36 0
7 3.22 38 0
8 2.21 37 0
9 3.15 39 0
<snip>
--------------------------------- end of file

-- in other words, a header and a blank line and a line
for each observation with spaces separating
values. Joseph -insheet-s it, -outfile-s it
as comma-separated and then -infile-s again.

Here is another way to do it. It is no better, but
different.

Copy and paste data into editor:

edit

The result is one string variable, -var1-.

Save the variable names

tokenize `= var1[1]'

and drop the first two lines

drop in 1/2

and then -split- and -destring- in one

split var1, destring

and finish with a renaming

forval i = 1/4 {
rename var1`i' ``i''
}

and dropping the original:

drop var1

Nick
[email protected]


*
* 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