Hi, I have a dataset with 96 variables and 28 observations per variable. I would like to run the nlp procedure for each variable. I am having difficulty doing so. (I am very new to SAS) The equation and data are the same for each run of nlp procedure. I just need to change one variable (called certain) each run through. In the end I would like to have 96 different estimates for alpha and gamma. I have set up the nlp proc in a macro with an input variable. I am not sure how to get the variables that I need from the data set one at a time and pass them into the macro. Please help! I have included what I am trying, unsuccessfully, to do below.... THanks, Jen /* This is the macro called nlp test the variable 'certain' needs to change 96 times THe equation works if I run it using one variable, the issue is when i try to loop through multiple variables...*/ %macro nlptest(certain); proc nlp data=Work.Prospect; lsq z; parms alpha=1, gamma=1; bounds 0.0001 < gamma < 2, 0.0001 < alpha < 2; weight = (nn_p1 ** gamma) /( ( (nn_p1 ** gamma) + (1-nn_p1) ** gamma) ** (1/gamma) ); value1 = nn_z1 ** alpha; value2 = nn_z2 ** alpha; z = (((weight * value1 + (1-weight) * value2) ** (1/alpha)) - &certain) / &certain; run; %mend nlptest; /*HERE IS WHERE I START TO RUN INTO TROUBLE..... */ data array1; set work.suregain; /* This data set contains the 96 variables I would like to loop through and pass into the macro for the nlp proc. */ array sure{*} _numeric_; /*I amk trying to create an array of the variables I need to pass to the macro */ input sure{*}; do i=1 to 96; %nlptest(sure{i}); /*Macro will not accept this as a value*/ end;
... View more