Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: iterative kolmogorov smirnov


From   "irodriguez" <[email protected]>
To   [email protected]
Subject   st: iterative kolmogorov smirnov
Date   Tue, 27 Jun 2006 15:47:55 -0300

I folowing wiggins and ruefli paper. They use an iterative kolmogorov smirnov approach to distinguish over time entries that perform significantly better or worse than their counterparts
My data set is a panel data with firms, industry, a variable of performance for 1990-2004 period.
I need help to know if this command is ok

Prep (Do file 1)

use ba se_perform

encode firm, gen(cod_firma)

keep if cod_sector==12

keep if initial_year==1999

reshape long roa, i(firm) j(year)

destring roa, replace

Coco (Do file 2)

capture gen estrato=1

capture gen fa=1

replace estrato=1 if estrato==0

sum cod_firma

return list

local numfirmas=r(max)

forvalues k=1/`numfirmas' {

replace fa=.

replace fa=1 if estrato==1

 capture replace fa=0 if cod_firma==`k' & estrato==1

 capture ksmirnov roa, by(fa)

 capture return list

 capture replace estrato=0 if r(p)<0.05 & fa==0

}

tab estrato

Una (Do file 3)

replace estrato=. if estrato==0

do coco

tab estrato

Media (Do file 4)

Summarize if estrato==1

Tab cod_firma estrato

Rep (Do file 5)

drop if estrato==1

replace estrato=1

do coco

tab estrato

thanks a lot




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