Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Programming Stata
Austin Nichols <firstname.lastname@example.org>
Re: st: Programming Stata
Wed, 17 Aug 2011 08:12:15 -0400
natasha agarwal <email@example.com>
Search for "balanced" in the first link provided:
On Wed, Aug 17, 2011 at 5:57 AM, natasha agarwal
> Hi Austin,
> You are absolutely right. This has got to do with Woolridge's APE stuff.
> I had a look at the links you posted (thanks for that) and it has got
> me a little confused.
> Is the APE calculation meant only for balanced panel (as his data is balanced)?
> On Tue, Aug 16, 2011 at 3:57 PM, Austin Nichols <firstname.lastname@example.org> wrote:
>> natasha agarwal <email@example.com>:
>> I am guessing this is related to Wooldridge's APE stuff:
>> I have some programs from 2007 or 2008 to calculate the APE, but I
>> never released them, as I was working on a large-grain parallelized
>> bootstrap to speed up the SE calculations that I never finished. I
>> guess I should revisit those programs, since there seems to be an
>> ongoing demand, but there is more than enough Stata code in
>> Wooldridge's presentations to help you write your own program for a
>> specific application.
>> One thing--in your program below you put -xb- as an option to -gen-
>> when you mean -predict-. Whenever you write a -program-, start by
>> running the commands interactively first, to debug your code.
>> On Tue, Aug 16, 2011 at 10:17 AM, Nick Cox <firstname.lastname@example.org> wrote:
>>> In addition to Neil's comments,
>>> 1. There is no obvious gain from writing this as a program.
>>> You might as well just run these commands in a do-file. Of course, this may be under development.
>>> 2. The line
>>> xtprobit expdum 'x', re
>>> will not work as the same character ' is used for both delimiters. You need
>>> xtprobit expdum `x', re
>>> Neil Shephard
>>> If you are going to write it as a program then you should save it as
>>> [filename].ado (not [filename].do as you are implying) and place it in
>>> one of your systems -adopath-'s (to see what these are simply type
>>> -adopath- in Stata.
>>> See [U] 16-18 for greater details on "Do-Files" (Chapter 16)
>>> "Ado-Files (Chapter 17) and "Programming Stata (Chapter 18).
>>> On 16 August 2011 13:41, natasha agarwal <email@example.com> wrote:
>>>> I am trying to write and run a program in Stata. The program I define
>>>> is as follows and I save it in the do-file
>>>> capture program drop fdi
>>>> program fdi, rclass
>>>> local x " lnvfdi mfdi"
>>>> xtprobit expdum 'x', re
>>>> gen double x1b1hat, xb
>>>> gen double scale = normalden(x1bhat1)
>>>> gen double pe1=scale*_b[lnvfdi]
>>>> summarize pe1, meanonly
>>>> return scalar ape1=r(mean)
>>>> drop x1b1hat scale pe1
>>>> When I type fdi, I get an error invalid file name.
>>>> Can anyone please help me?
* For searches and help try: