Hello everyone,
I am currently working with Panel Data (firm, year) for my seminar paper and I am in the phase of preparing the data for the analysis. My problem now is as followed:
I generated the variable CETR (Cash Effective Tax Rate) with the command
gen CETR = CF_TAXATION / PRETAX_INCOME
The results included some negative values, some values larger than 1 and also missing values.
Now, in an effort to control for outliers I wanted to winsorize the values for CETR to 0 and 1, i.e. if CETR has a value >1 it should be defined as 1 and if CETR<0 it should be defined as 0.
replace CETR=0 if CETR<0
replace CETR=1 if CETR>1
After looking at the results, I observed that Stata now assigned the value 1 to originally missing data of CETR, because Stata treats missing values as positive infinity. Since I have a significant amount of missing data this biases my results substantially. So my question is therefore, how do I have to alter the previous commands to prevent such a biased result or i.e. how do I tell Stata to keep missing values missing in such a setting?
Thanks in advance and kind regards,
Lucas
Related Posts with How do I keep "missing values" missing?
The problem with count if syntax regarding encoded string variablesFrom the dataset hospdd given by STATA (https://www.stata-press.com/data/r17/hospdd.dta), I want to …
Seeking help with unbalanced panel data analysisHi, I have recently analyzed an unbalanced panel data, but since it is my first time to work with su…
PPML estimation with bilateral trade agreement dummies.Hello everyone! I am applying PPML estimation to analyze the impact of two trade agreements (both b…
Spatial shocks: when is collinearity too much?Hi, I am working with a municipality-level dataset. I am analysing the effect of immigration shocks…
Confusion about the example in STATA help file of didregressToday I read the detail description of didregress from STATA. from page 6 and 7, there is a point th…
Subscribe to:
Post Comments (Atom)
0 Response to How do I keep "missing values" missing?
Post a Comment