[Limdep Nlogit List] bootstrap LCM

Bos J.W.B. jwb_bos at yahoo.com
Wed Mar 20 03:10:20 AEDT 2019


Hi Bill,

Thanks! Very helpful indeed!!!

A related question…. Am trying to write a procedure that would allow me to run the same model on a large number of data sets. I have in mind the following:

proc
do for;i=1,1000$
calc;i=1$
IMPORT;FILE="i.csv"$
regress;lhs=y;rhs=one,x$
EXPORT;FILE="output_i.csv"
calc;i+1$
enddo$
endproc

execute

I cannot figure out how to get the import and export to work. Is it possible at all? 

gr, Jaap

> On Feb 19, 2019, at 10:19 PM, William Greene via Limdep <limdep at mailman.sydney.edu.au> wrote:
> 
> Jaap.  In your regression spec in the procedure, you have RHS=one,x and
> LCM=x.
> This is surely overspecified - the same variables appear in the equation
> and in the
> class probabilities.  In the specification of the model, you have ;PDS=ni,
> which means
> that the class specification is the same from period 1 to period n1.  But,
> with ;LCM=x,
> you have the class probabilities changing over time.  the result should be
> unpredictablle.
> In fact, I believe that limdep is ignoring periods 2 - ni of X in computing
> the class
> probabilities.  But, again, the result seems to me like it might go awry.
> Also, shouldn't
> you be using a block bootstrap?  Your data are a panel.  You should have
> pds=ni in the
> EXEC command.  Also, I don't think you want to repead
> CProb=Cprob;Group=Group;keep=fitopen
> 1,000 times.  Do this with the original, non-bootstrapped regression.
> Finally, you might want
> to define BB to have 2*K cells.
> Best regards,
> Bill
> 
> On Mon, Feb 18, 2019 at 8:59 AM Bos J.W.B. via Limdep <
> limdep at mailman.sydney.edu.au> wrote:
> 
>> Dear all,
>> 
>> I’m trying to bootstrap a latent class model. As a basis for my code, I
>> use the procedure described in the manual, section R15-3.
>> 
>> Here’s my code:
>> 
>> REGRESS;Lhs=klspe1;Rhs=one,klopen1,klopen1q,klywork$
>> 
>> namelist;x=klopen1,klopen1q,klywork$
>> calc;k=col(x)$
>> matrix;bb=init(k,1,0.0)$
>> PROC
>> REGRESS;Lhs=klspe1;Rhs=one,klopen1,klopen1q,
>> klywork;LCM=X;Pds=ni;Pts=2;algs=bfgs;maxit=2000;
>> parameters;CProb=Cprob;Group=Group;keep=fitopen$
>> MATRIX;bb=b$
>> ENDPROC
>> EXEC;Bootstrap=bb;N=1000$
>> 
>> The problem with this code is that it only bootstraps the coefficients for
>> one class. Does anyone know the solution to this problem? I guess modifying
>> the namelist command should do the trick, but I am not sure how….
>> 
>> gr, Jaap Bos
>> 
>> _______________________________________________
>> Limdep site list
>> Limdep at mailman.sydney.edu.au
>> http://limdep.itls.usyd.edu.au
>> 
> 
> 
> -- 
> William Greene
> Department of Economics
> Stern School of Business, New York University
> 44 West 4 St., 7-90
> New York, NY, 10012
> URL: https://protect-au.mimecast.com/s/dpPVCyoNVrcGvPzpuZtWv6?domain=people.stern.nyu.edu
> Email: wgreene at stern.nyu.edu
> Ph. +1.212.998.0876
> Editor in Chief: Journal of Productivity Analysis
> Editor in Chief: Foundations and Trends in Econometrics
> Associate Editor: Economics Letters
> Associate Editor: Journal of Business and Economic Statistics
> Associate Editor: Journal of Choice Modeling
> _______________________________________________
> Limdep site list
> Limdep at mailman.sydney.edu.au
> http://limdep.itls.usyd.edu.au
> 



More information about the Limdep mailing list