[R] Package PLM

2013-07-03 Thread Eliano Marques
Hi Giovanni and Yves,

My is Eliano Marques, i'm a master degree econometrician from ISEG in
Portugal.

I was trying to use your R package with a specific output i cannot get the
same results that i'm getting in Stata.

Could you please let me know if the below is correct or if i'm missing
anything?

On the below model I want to run a model for 62 companies for a 5 year
period:

log(revenue+2)it = log(revenue+2)(-1)it*b1 + log(Cost+2)(-1)it*b2 +
log(Cost+2)it*b3 + vit
modeloutput<- pgmm(log(Revenue+2) ~ lag(log(Revenue+2), 1)+
lag(log(Cost+2), 0:1)
 | lag(log(Cost+2), 2:99) +
lag(log(Cost+2), 2:99) ,
data = BD, effect = "twoways", model = "onestep",
transformation = "ld")
summary(modeloutput, robust = TRUE)

I want to include time.dummies in both equation in level and differences.

I get this output:

Coefficients
Estimate Std. Error z-value  Pr(>|z|)
lag(log(Revenue + 2), 1)0.486593   0.146151  3.3294 0.0008703 ***
lag(log(Cost+ 2), 0:1)0  1.165293   0.069329 16.8081 < 2.2e-16 ***
lag(log(Cost + 2), 0:1)1 -0.565378   0.199199 -2.8383 0.0045360 **

>From Stata, running the following code I get this:

xtabond2 lnrevenue l.lnrevenue lncost l.lncost  i.year , iv(i.year  )
 gmm(l.lnrevenue lncost ) robust small

  lnrevenue |  Coef.   Std. Err.  tP>|t| [95% Conf.
Interval]
-+
   lnrevenue |
 L1. |.358987   .1176716 3.05   0.003  .123688
.594286
 |
lncost |
 --. |   1.185943   .036389132.59   0.000 1.113179
 1.258708
 L1. |  -.4332851   .1551862-2.79   0.007-.7435992
-.1229711
 |
year |
   2009  |  -.2100918   .0466175-4.51   0.000-.3033094
-.1168743
   2010  |  -.0936157   .0365742-2.56   0.013-.1667503
 -.020481
   2011  |  -.0351653.036502-0.96   0.339-.1081556
.037825
 |
   _cons |   .3372286.194194 1.74   0.088-.0510863
 .7255435
--
Instruments for first differences equation
  Standard
D.(2008b.year 2009.year 2010.year 2011.year 2012.year)
  GMM-type (missing=0, separate instruments for each period unless
collapsed)
L(1/4).(L.lnrevenue lncost)
Instruments for levels equation
  Standard
2008b.year 2009.year 2010.year 2011.year 2012.year
_cons
  GMM-type (missing=0, separate instruments for each period unless
collapsed)
D.(L.lnrevenue lncost)

Do you what I be doing wrong to correct this values?

Many thanks in advance,
Eliano

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with a function and text

2013-03-06 Thread Eliano Marques
Hi, can I understand why this message was rejected ?
Thanks,
Eliano

Sent from my iPhone

On 6 Mar 2013, at 19:18, Eliano  wrote:

> Hi everyone,
>
> I am writing some code to generate a function. I am passing that code to a
> dataset which i'm importing in R, e.g.
> Test=read.table('C:/test.txt', header=F, sep='\t', na.strings='NA', dec='.',
> strip.white=TRUE)
> Test
>
> V1
> (if(nclusters>0){OptmizationInputs[3,3]*beta[1]}else{0})+"
> (if(nclusters>1){OptmizationInputs[3,3]*beta[1]}else{0})+"
> V1 has inside a code for a function.
>
> I'm having problems with 2 things:
>
> 1 - I need to take out from V1 all " that appears in the text, i tried a
> replace but did not work.
> Test=replace(Test,' " ', ' ')  , did not work.
>
> 2 - Writing a function like this :
>
> nlog=function(par)
>{
>beta=par[1:n]
>Measure=Test[1]  # would this read the text?
>return(Measure)
>}
>
> So i need to use that code inside the function as above.
> Any suggestion on how you would do this?
>
> Kind Regards,
> Eliano
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Help-with-a-function-and-text-tp4660523.html
> Sent from the R help mailing list archive at Nabble.com.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Maximization Problem

2011-10-25 Thread Eliano Marques
Hi there,

I need help in an optimization procedement.

I'm trying to maximize the function fn=x^2+5y^2 with the restriction of
fn1=x-y<=5.

I tried the genoud method and as well the alabama method.

I have problems to set the constraint in R.

Can someone help me please?

Regards,
Eliano

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.