search for: ind1year2000

Displaying 1 result from an estimated 1 matches for "ind1year2000".

2010 Aug 01
3
remove extreme values or winsorize – loop - dataframe
...t;-subset(data,data$industry==1) ind1year1999<-subset(industry1,industry1$year==1999) q1<-quantile(ind1year1999$X1,probs=0.1,na.rm=TRUE) q99<-quantile(ind1year1999$X1,probs=0.90,na.rm=TRUE) ind1year1999winsorized<-transform(ind1year1999,X2=ifelse(X1<q1,q1,ifelse(X1>q99,q99,X1))) ind1year2000<-subset(industry1,industry1$year==2000) q1<-quantile(ind1year2000$X1,probs=0.1,na.rm=TRUE) q99<-quantile(ind1year2000$X1,probs=0.90,na.rm=TRUE) ind1year2000winsorized<-transform(ind1year2000,X2=ifelse(X1<q1,q1,ifelse(X1>q99,q99,X1))) I repeat this for all years and industries, an...