BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AllSoEasy
Obsidian | Level 7

Hello all,

From the parameter output of Proc Model ("Nonlinear OLS Parameter Estimates") I am obtaining the Standard Errors of each of my parameter estimates to append to another file of all my parameter data. Basically the data I get from the ods output is formatted as such:

ParameterStdErr
A10.9174
B10.2323
B20.2418
B30.0778
gamma0.0145

I would like to manipulate this data to a one row data-set as such:

StdErr_A1StdErr_B1StdErr_B2StdErr_B3StdErr_gamma
0.91740.23230.24180.0778

0.0145

I have been trying to do this by storing the parameter I'm currently on in a datastep to a macro variable that can I use to concatenate a variable name and assign the StdErr to, as such:

data stderr_out2;

  set stderr_out;

  call symputx("parm", parameter);

  stderr_&parm. = StdErr;

run;

This won't give me the desired end-result yet, but I will at least have the correct variable names with their respective values and I can get to this final result with another datastep. However, this is not working at all, I only get one column added that corresponds to the last parameter, i.e. I will get this:

ParameterStdErrstderr_gamma
A10.9173662460.917366246
B10.2323230770.232323077
B20.2418390230.241839023
B30.0778139460.077813946
gamma0.0144711110.014471111

Rather than a new column for each parameter, only the column from the last macro is placed in the data set. Am I going about this a completely incorrect way? This seems like it should be fairly simple to do and I've gotten somewhat stumped as to what is going on here. Please if you have any suggestions I would appreciate it a great deal.

Thanks!!

-Ryan

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I think you want to use PROC TRANSPOSE, with the ID statement, something like (untested)

PROC TRANSPOSE DATA=whatever OUT=transpose;

     var stderr;

    id parameter;

run;

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I think you want to use PROC TRANSPOSE, with the ID statement, something like (untested)

PROC TRANSPOSE DATA=whatever OUT=transpose;

     var stderr;

    id parameter;

run;

--
Paige Miller
AllSoEasy
Obsidian | Level 7

Well I feel really silly that it was that easy!! I don't know why I didn't think of using proc transpose with the ID statement for this. Thank you for the quick answer!!

-Ryan

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 659 views
  • 0 likes
  • 2 in conversation