Displaying 3 results from an estimated 3 matches for "industry1".
Did you mean:
industry
2010 Aug 01
3
remove extreme values or winsorize – loop - dataframe
...,10),rep(8,10),rep(9,10),
rep(10,10)),1000)
X1<-rnorm(10000)
data<-data.frame(firm, industry,year,X1)
data
The way I?m doing this is very hard. I split my sample by
industry and year, for each industry and year I calculate
the 10% and 90% quantiles, then I create a X2 variable
like this:
industry1<-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)))...
2013 Apr 03
1
linear model coefficients by year and industry, fitted values, residuals, panel data
...ms, by year and industry, and with financial information (variables X, Y, Z, for example), the number of firms by year and industry is not always equal, the number of years by industry is not always equal.
#reproducible example
firm1<-sort(rep(1:10,5),decreasing=F)
year1<-rep(2000:2004,10)
industry1<-rep(20,50)
X<-rnorm(50)
Y<-rnorm(50)
Z<-rnorm(50)
data1<-data.frame(firm1,year1,industry1,X,Y,Z)
data1
colnames(data1)<-c("firm","year","industry","X","Y","Z")
firm2<-sort(rep(11:15,3),decreasing=F)
year2<-rep(2...
2013 Jun 07
4
matched samples, dataframe, panel data
...first have a corresponding firm in the second with the same
#year, industry and dimension (the dimension doesn't need to be exactly the
#same, it could vary in an interval of +/- 10%, for example)
#My reproducible example
firm1<-sort(rep(1:10,5),decreasing=F)
year1<-rep(2000:2004,10)
industry1<-rep(20,50)
dummy1<-c(0,0,1,1,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,0,0,1,0,0,0,0,0,1,1,1)
dimension1<-c(2120,345,2341,5678,10900,4890,2789,3412,9500,8765,4532,6593,12900,123,2345,3178,2678,6666,647,23789,
2189,4289,8543,637,23456,781,35489,2345,5754,8976,32...