Date: Wed, 8 Feb 2006 09:35:56 Z
Reply-To: Dirk Nachbar <Dirk.Nachbar@DWP.GSI.GOV.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dirk Nachbar <Dirk.Nachbar@DWP.GSI.GOV.UK>
Subject: panel logit model
Content-Type: text/plain; charset="us-ascii"
dear all
i am writing a panel logit macro using proc nlmixed. i want to use initial
values from a simple OLS regression (proc reg). unfortunately the data _null_
step doesn't work. What I basically want is &parms and &xb to contain the
initial values and the functional form for proc nlmixed, respectively.
help would be appreciated, Dirk
%macro panellogit(data=,var=,exp=,id=);
proc reg data=&data outest=_temp_ (keep=&exp intercept);
model &var=&exp;
run; quit;
%let exp=&exp intercept;
%let expCount = %eval( %length(&exp) - %length( %sysfunc( compress(&exp) ) ) +
1 ) ;
data _null_;
set _temp_;
%do i=1 %to &expCount;
call symput ("%scan(&exp,&i)",%scan(&exp,&i));
%let parms=&parms %eval(%scan(exp,&i))=%eval(&%scan(&exp,&i));
%let xb=&xb %eval(&%scan(&exp,&i)*%scan(&exp,&i));
%end;
run;
proc nlmixed data=&data;
parms &parms s2e=100;
xb=&xb;
num = exp(xb);
denom = 1+exp(xb);
model y ~ normal(num/denom+u,s2e);
random u ~ normal(0,s2u) subject=&id;
run;
%mend;
Dirk Nachbar
Assistant Economist
Pensim2
Department for Work and Pensions
Level 4, The Adelphi
1-11 John Adam St
WC2N 6HT London
020 796 28531
**********************************************************************
This document is strictly confidential and is intended only for use by the addressee.
If you are not the intended recipient, any disclosure, copying, distribution or other
action taken in reliance of the information contained in this e-mail is strictly prohibited.
Any views expressed by the sender of this message are not necessarily those of the Department
for Work and Pensions.
If you have received this transmission in error, please use the reply function to tell us
and then permanently delete what you have received.
Please note: Incoming and outgoing e-mail messages are routinely monitored for compliance
with our policy on the use of electronic communications.
**********************************************************************
The original of this email was scanned for viruses by the Government Secure Intranet (GSi) virus scanning service supplied exclusively by Cable & Wireless in partnership with MessageLabs.
On leaving the GSi this email was certified virus-free