Displaying 20 results from an estimated 1146 matches for "firms".
Did you mean:
fires
2012 Mar 09
1
From (common IDs different Names) To (common IDs common Names)
Dear Community
I have a large dataframe x as follows with common ids but different names:
> x <- data.frame(ID = c(1,1,2,2,2,3,3),
+ Name = c("B Branch A Firm ","A Firm","B Firm","B Firm","B Firm C Branch","C Firm","C Firm A Branch")
+ )
> x
ID Name
1 1 B Branch A Firm
2 1 A Firm
3 2
2005 Dec 29
9
Single Table Inheritance
Hi all,
Quick question for STI. With the following setup:
class Company < AR::Base; end
class Firm < Company; end
Why does Firm.find(:all) return all Companies, not just those that have
type==''Firm''?
--
Alex
2005 Sep 05
4
Dummy variables model
..., all!
Anyone know an easy way to specify the following model.
Panel dataset, with stock through time, by firm.
I want to run a model of y on a bunch of explanatory variables, and one
dummy for each firm, which is 1 for observations that come from firm i,
and 0 everywhere else. I have over 200 firms (and a factor variable that
contains a firm identifier).
Any easy way of going about this, without having to define all these
dummies? I checked lme() with random = ~ 1|firm, but the problem is that
these are random effects, i.e. that there are firm-by-firm disturbance
terms and overall dist...
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers
#I have a data panel of thousands of firms, by year and industry and
#one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not
#and another variable the represents the firm dimension (total assets in thousand of euros)
#I need to create two separated samples with the same number os firms where...
2009 May 04
4
Creating a variable which is the sum of equal rows in a dataframe
Hi everyone:
I need to count the number of banks of each firm in my
data. The firm is identified by the fiscal number. The
banks of each firm appears like this:
Firm Banks
500600700 Citybank
500600700 CGD
500600700 BES
500600800 Citybank
500600800 Bank1
500600900 CGD
I want to obtain the following dataframe:
Firm
2011 May 19
2
balanced panel data
I have a dataframe with many firm-year observations and many variables.
Not all firms have information for all the years.
I want another dataframe with only those firms that have information all
years.
This is, I want a balanced panel data, but with the maximum number of years.
In my reprocucible example I want to keep firms 1,2 and 3 (period 2000 to
2004).
I need your help...
2011 Oct 02
2
subset in dataframes
...ame(year=c(2001,2002,2003,2004,2001,2002,2003,2004,
2001,2002,2003,2004,2001,2002,2003,2004),
firm=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),x=c(11,22,-32,25,-26,47,85,98,
101,14,87,56,12,43,67,54),
y=c(110,220,302,250,260,470,850,980,1010,140,870,560,120,430,670,540))
data1
I want to keep the firms where all x>0 (where there are no negative values
in x)
So my output should be:
year firm x y
1 2001 3 101 1010
2 2002 3 14 140
3 2003 3 87 870
4 2004 3 56 560
5 2001 4 12 120
6 2002 4 43 430
7 2003 4 67 670
8 2004 4 54 540
So I'...
2006 Jun 03
1
Can I tell if the associated record is new in a belongs_to save?
In a belongs_to association, is there a way to tell if the associated object
was newly created?
Hopefully this will explain my question:
A Firm class declares
has_many<http://api.rubyonrails.com/classes/ActiveRecord/Associations/ClassMethods.html#M000530>:clients
and a
client class declares
2009 May 10
1
Select the rows in a dataframe that matches a criteria in another dataframe
...0400400 2007 340
500400400 2006 890
500400400 2005 250
Dataframe 2
Firm Audited consolidate
500400200 yes no
500400300 yes yes
500400400 no no
I want to make another dataframe equal to the dataframe1,
but just with the firms ?audited?, or with the firms
?audited? and ?consolidate?. For example, with the audited
and consolidated, the output would be just firm 500400300,
like this:
Firm Year cash
500400300 2007 300
500400300 2006 240
500400300 2005 120
I?ve tried intersect () but it...
2013 Apr 08
2
How can I extract part of the data in a panel dataset?
Taking the Grunfeld data, which is built-in in R, for example,
(1)How can I construct a dataset (or dataframe) that consists of the data
of all firms in 1951?
(2)How can I calculate the average capital in each form over the period
1951-1954?
What I can imagine is to categorize the data by firm, and then select the
data between 1951 and 1954 for each firm, but how can I do it?
Thanks,
Miao
Grunfeld data:
invest value capital firm year 317....
2010 Jan 22
2
sorted reshaping?
dear R wizards:? I am wrestling with reshape.? I have a long data set
that I want to convert into a wide data set, in which rows are firms
and columns are years.
> summary(rin)
firm fyear sim1
Min. :1004.00 Min. :1964.0 Min. : -1.00000
1st Qu.:1010.00 1st Qu.:1979.0 1st Qu.: -0.14334
Median :1016.00 Median :1986.0 Median : 0.00116
Mean :1016.34 Mean :1986.1 Mean : 1.0...
2013 Oct 15
1
Problem with lapply
Hi together
I'm pretty new to R, so excuse me if it is a basic question.
I have a big dataset (extract of it found in the attachment) of returns from
firms. I'd like to compute the Pearson correlation of each firm with the
"Market" and the corresponding p-Value. So I thought of making a list of
'cor.test's and then extract the needed values with a for loop. What I did
so far...
dataset=Testcor
dataset$DATE<-as.Date(dataset$DAT...
2013 Jan 11
0
Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
Dear R users,
I wish to manually demean a panel over time and entities. I tried to code
the Wansbeek and Kapteyn (1989) transformation (from Baltagi's book Ch. 9).
As a benchmark I use both the pmodel.response() and model.matrix() functions
in package plm and the results from using dummy variables. As far as I
understood the transformation (Ch.3), Q%*%y (with y being the dependent
variable)
2010 Jul 22
4
Drop firms in unbalanced panel if not more than 5 observations in consecutive years for all variables
...ar R-user,
a few weeks ago I consulted the list-serve with a similar question.
However, my task changed a little but sufficiently to get lost again. So
I would appreciate any help on the following issue.
I use the plm package and work with firm-level data in a panel. I would
like to eliminate all firms that do not fulfill the requirement of
having an observation in every variable used for at least x consecutive
years.
For illustration of the problem assume the following data set
> data
id year y z
1 a 2000 1 1
2 b 2000 NA 2
3 b 2001 3 3
4 c 1999 1 1
5 c 2000 2 2
6 c...
2010 Nov 25
1
Help on running regression by grouping firms
Hi there,
I have a huge data set with multiple firms years and other firm characteristics. I want to run a regression on the dependent variable and other explanatory variables and calculate the residual terms by grouping the firms in same year and same industry.
What I want to do is to divide my obseravtion into sub sample that contains the observa...
2008 Jun 05
7
Improving data processing efficiency
...at I need to be doing a lot of data selection and
subsetting, and looping (yikes!), but the result appears to be highly
inefficient and takes ages (well, many hours). What I am doing, in
pseudocode, is this:
1. for each quarter of data, getting out all the IPOs and all the
eligible non-issuing firms.
2. for each IPO in a quarter, grab all the non-issuers in the same
industry, sort them by size, and finally grab a matching firm closest in
size (the exact procedure is to grab the closest bigger firm if one
exists, and just the biggest available if all are smaller)
3. assign the matched firm-o...
2004 Jun 17
2
Question on lists and vectors of lists
...Could someone please point
me in the right direction?
I have a function which will run for thousands of companies. At each
invocation, it returns 2 numbers. I plan to do something like:
think_one_firm <- function(filename) {
# Do stuff
return(list(x=x,y=y))
}
So for each of the firms in my dataset, I will call
think_one_firm(datafilename) and it will give me back two numbers x
and y. I could say:
l = think_one_firm("blah")
print(l$x); print(l$y);
and all would be fine.
What I want to do is: To tuck away the returned lists into a vector or
a data frame.
At the...
2010 Mar 16
2
plm "within" models: is the correct F-statistic reported?
Dear R users
I get different F-statistic results for a "within" model, when using
"time" or "twoways" effects in plm() [1] and when manually specifying
the time control dummies [2].
[1] vignette("plm")
[2] http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
Two examples below:
library("AER")
data("Grunfeld", package =
2013 Apr 03
1
linear model coefficients by year and industry, fitted values, residuals, panel data
Hi R-helpers,
My real data is a panel (unbalanced and with gaps in years) of thousands of firms, 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)
in...
2007 Nov 30
1
rollapply on zoo object
Dear R users.
I have zoo object "size_june" containing market-capital values:
> dim(size_june) # market-cap data of 625 firms for 20 years
[1] 20 625
> class(size_june)
[1] "zoo"
> size_june # colnames = "size.firmcode"
size.34020 size.4710 size.11050 size.10660 size.9540 size.8060
size.16160 size.8080 size.9280
1988-06-30 NA NA NA NA NA
NA...