0

I created an Anova and want to save the mean, standard deviation, F-statistics and the p-Value in a new data set. This is my current code:

ODS OUTPUT means=anova;
PROC ANOVA DATA= multiple_sclerosis;
CLASS ms_form;
MODEL eq5d = ms_form;
MEANS ms_form;
RUN;
quit;
ods output close;

Thanks for any help!

Nico
  • 5
  • 5
  • You don't actually say what the issue is here at all.... – Reeza Oct 06 '17 at 20:01
  • @Reeza I think OP does; OP wants to get various statistics into a dataset. – Joe Oct 06 '17 at 20:03
  • Yes, but s/he should actually state what the problem is with the code they've provided vs what they need. There's nothing there to indicate the actual issue unless you're intimately familiar with the ODS output for ANOVA. – Reeza Oct 06 '17 at 20:27
  • I think the way it's stated is fine: they want to know how to save the ... statistics. That's pretty clear, and it's quite easy to answer without knowing the ins and outs of ODS OUTPUT for ANOVA (I've never run PROC ANOVA in any other context than this...) – Joe Oct 06 '17 at 21:33

2 Answers2

1

You can add ODS TRACE ON; before your code to see the names of the tables that it outputs. In this case, I think you want the ModelANOVA table (the second table in the Output/Results window).

ODS OUTPUT means=anova modelAnova=model;
PROC ANOVA DATA= sashelp.cars;
  CLASS cylinders;
  MODEL mpg_highway=cylinders;
  MEANS cylinders;
RUN;
quit;
ods output close;
Joe
  • 62,789
  • 6
  • 49
  • 67
0

You have to add "outstat=" statement. Try this:

PROC ANOVA DATA= multiple_sclerosis;
CLASS ms_form;
MODEL eq5d = ms_form;
MEANS ms_form;
OUTSTAT = <output library>.<output table>; /* <--- */
RUN;
Grigory P
  • 191
  • 1
  • 8
  • 24