Displaying 2 results from an estimated 2 matches for "x1_3".
Did you mean:
x13
2005 Sep 15
1
Coefficients from LM
...one,
Can anyone tell me if its possibility to extract the coefficients from the
lm() command?
For instance, imagine that we have the following data set (the number of
observations for each company is actually larger than the one showed...):
Company Y X1 X2
1 y_1 x1_1 x2_1
1 y_2 x1_2 x2_2
1 y_3 x1_3 x2_3
(...)
2 y_4 x1_4 x2_4
2 y_5 x1_5 x2_5
2 y_6 x1_6 x2_6
(...)
n y_n x1_n x2_n
n y_n1 x1_n1 x2_n1
n y_n2 x1_n2 x2_n2
(...)
I need to run a regression of Y=b0+b1*X1+b2*X2 for EACH company in the
dataset and then retrieve the coefficients for each regression obtained (and
t-stats and R^2) f...
2013 Apr 18
1
select and do some calculations/manipulations on certain rows based on conditions in R
...? ? ?0
>>
>
>I want to create a Y column where Y = 1 if there is an observation for the
>same ID right below it and if the Sum of the product of the X's =1 for the
>two consecutive observations of the same ID. Y=0 otherwise.
>
>So for example, ?Y3=1 because Sum(x0_3*x0_4+x1_3*x1_4+...+x15_3*x15_4)=1.
>
>Can I create program that can do the calculation for Y conditioning on the
>ID (i.e. if the ID changes then Y=0) and second conditioning on the sum of
>the product of the X's for two consecutive rows if the ID condition is met,
>i.e. ID stays the same?...