0
votes

I am using the PROC LTA plugin provided by The Methodology Centre at PennState. It writes output to the SAS output window, but not in the usual HTML format. It appears to be just text. Is there a way I can easily copy the values from the output into a Word document?

Things I have tried:

  1. Copy pasting directly from SAS output into Word or Excel. It does not correctly place values into cells.
  2. Printing the output to a PDF, and copying from that PDF. It does not correctly place values into cells.
  3. Using the ODS system. It does not seem to save any results to ODS. I have checked using ODS TRACE.

TIA.

2
Can you add some sample data and working code to the question ? Have you used any of the OUT###= options? Do those output tables contain any of the results you need in your document ?Richard
After reading the PROC LTA user guide further, I found what I was looking for using the OUTEST and OUTPARAM options to save the required tables as datasets. I will use ODS to output these tables to Word.Cybernike

2 Answers

2
votes

Without seeing data and LTA code, you can save the OUTPUT window contents and, via ODS with style=monotype, copy that into a document with a DATA _NULL_ Step.

Example (LCA code from plugin page):

DATA test;
INPUT it1 it2 it3 it4 count;
DATALINES;
1 1 1 1 5
1 1 1 2 5
1 1 2 1 9
1 1 2 2 8
1 2 1 2 5
1 2 2 1 8
1 2 2 2 4
2 1 1 1 5
2 1 1 2 3
2 1 2 1 6
2 1 2 2 8
2 2 1 1 3
2 2 1 2 7
2 2 2 1 5
2 2 2 2 10
;
RUN;

dm 'clear output';

PROC LCA DATA=test ;
NCLASS 2;
ITEMS it1 it2 it3 it4;
CATEGORIES 2 2 2 2;
FREQ count;
SEED 100000;
RHO PRIOR=1;
RUN;

* save contents of output window to catalog entry;
dm 'output; saveas work.lca.results.output';

filename results catalog 'work.lca.results.output';

ods rtf file='results.rtf' style=monospace;

title; footnote;
options nodate nonumber nocenter;

* read contents of catalog entry and write to ODS;
data _null_;
  infile results;
  input;
  line = _infile_;
  file print ods;
  put _ods_;
run;

ods rtf close;

Document (image of)
enter image description here

0
votes

The PROC LCA and PROC LTA procedures include the OUTPOST, OUTEST and OUTPARAM options that allow you to save some results to datasets, which can then be printed using ODS.

Example code:

DATA test;
INPUT it1 it2 it3 it4 count;
DATALINES;
1 1 1 1 5
1 1 1 2 5
1 1 2 1 9
1 1 2 2 8
1 2 1 2 5
1 2 2 1 8
1 2 2 2 4
2 1 1 1 5
2 1 1 2 3
2 1 2 1 6
2 1 2 2 8
2 2 1 1 3
2 2 1 2 7
2 2 2 1 5
2 2 2 2 10
;
RUN;

PROC LTA DATA=test OUTEST=est1 OUTPARAM=par1 ;
NSTATUS 2;
NTIMES 4;
ITEMS it1 it2 it3 it4;
CATEGORIES 2;
SEED 100000;
RUN;

ods rtf file="results.rtf"; 
    proc print data=par1; run;
ods rtf close;