Quantcast

Indicator variables and interactions in est2tex and outreg2

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Indicator variables and interactions in est2tex and outreg2

rzultan
This post has NOT been accepted by the mailing list yet.
Hi,

I'm trying to construct regression tables for Latex without success. The estimation command is:

xtreg par c.optimal##c.optimal##c.optimal##Ab b99.bet##Ab##Be, i(U)

where Ab has two levels, 1 and 2 and Be has two levels, 0 and 1. If Be=0, then bet=99, and if Be=1, then bet takes values of (1 2 3). I include the redundant variable Be in the estimation to use as a dimension in marginsplot.

Using est2tex, I run:

est2vec gap, e(N_g sigma_u sigma_e) vars(_cons 2.Ab 1.bet 2.bet 3.bet Ab#bet optimal optimal#optimal optimal#optimal#optimal) name(1) replace

which results in the correct matrices. Running:

est2tex gap, preserve replace

creates a nice matrix gap_tbl (which can also be created by est2one). However, I then get an error message:

error (as svmat was applied)
invalid syntax

Which I assume is because of the variable names in e(), which include the interaction symbol # and indicator prefixes such as 2.Ab and 99b.bet.

I tried to do the same with outreg2, e.g.,

outreg2 2.Ab 1.bet 2.bet 3.bet Ab#bet optimal c.optimal#c.optimal c.optimal#c.optimal#c.optimal using gap, replace tex see

But the resulting table drops all of the indicator variables. I tried with different formats such as i.Ab, but nothing works.

I would be grateful for any solution, either using est2tex or outreg2.

Thanks.

Ro'i Zultan


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Indicator variables and interactions in est2tex and outreg2

Jan Kabatek
This post has NOT been accepted by the mailing list yet.
Hi,

your problem is most likely the name. Change "1" into something non-numeric, and it should do the trick.

Jan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Indicator variables and interactions in est2tex and outreg2

rzultan
This post has NOT been accepted by the mailing list yet.
Hi,

Thanks. I managed to find a solution a while back using the drop and keep options.

Cheers,
Ro'i

2012/11/5 Jan Kabatek [via Statalist] <[hidden email]>
Hi,

your problem is most likely the name. Change "1" into something non-numeric, and it should do the trick.

Jan


If you reply to this email, your message will be added to the discussion below:
http://statalist.1588530.n2.nabble.com/Indicator-variables-and-interactions-in-est2tex-and-outreg2-tp7580227p7580264.html
To unsubscribe from Indicator variables and interactions in est2tex and outreg2, click here.
NAML



--
Ro'i Zultan
Department of Economics
Ben-Gurion University of the Negev
Tel: +972 (0) 8 6472306
E-mail: [hidden email]l

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Indicator variables and interactions in est2tex and outreg2

rdcfqz
This post has NOT been accepted by the mailing list yet.
Hi,

I have the same errors. Would you please give me more details about how you fix it?

Best regards,
Arthur
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Indicator variables and interactions in est2tex and outreg2

rzultan
This post has NOT been accepted by the mailing list yet.
Hi Arthur,

I ended up using outreg2, explicitly specifying all variables that I wanted in. The final code was:

outreg2 using gap, e(sigma_u sigma_e rho) keep(2.Absentmindedness 1.bet 2.bet 3.bet 2.Absentmindedness#1.bet ///
2.Absentmindedness#2.bet 2.Absentmindedness#3.bet optimal c.optimal#c.optimal c.optimal#c.optimal#c.optimal ///
2.Absentmindedness#c.optimal 2.Absentmindedness#c.optimal#c.optimal 2.Absentmindedness#c.optimal#c.optimal#c.optimal) ///
see tex(pretty landscape)

I hope this helps!
Ro'i

2013/2/13 rdcfqz [via Statalist] <[hidden email]>
Hi,

I have the same errors. Would you please give me more details about how you fix it?

Best regards,
Arthur


If you reply to this email, your message will be added to the discussion below:
http://statalist.1588530.n2.nabble.com/Indicator-variables-and-interactions-in-est2tex-and-outreg2-tp7580227p7580309.html
To unsubscribe from Indicator variables and interactions in est2tex and outreg2, click here.
NAML



--
Ro'i Zultan
Department of Economics
Ben-Gurion University of the Negev
Tel: +972 (0) 8 6472306
E-mail: [hidden email]l
Loading...