how might I get spss to read this

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

how might I get spss to read this

Maguin, Eugene

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Jon Peck
You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Maguin, Eugene

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Bruce Weaver
Administrator
In reply to this post by Maguin, Eugene
Hi Gene.  Is this a one-time task involving only the output you've shown?  Or
does it have to be repeated multiple times for other sets of output?  I'm
just trying to get a sense of how scalable a solution needs to be, how much
manual editing can be tolerated, etc.  Thanks.  



Maguin, Eugene wrote

> I've got sas proc gee analysis results that I have tabulated like this.
> The real problem is that sas in its wisdom does not print (or have an
> option in proc gee to print) the odds ratios (OR) when the distribution is
> not normal. Line 1 is a text string with no tabs; line 2 and subsequent
> lines within each summary block are tabbed as shown. What I want to do is
> to read in the summary lines and in the lines following line 2, the header
> line, compute the OR and write it in the correct position at output time
> and then write everything back out so that I can swap it with the input
> text in the word file.
>
> I'm assuming it's impossible to read line 1 as an a80 text string and then
> read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as
> a80. True?
> An alternative is to read all lines as text strings and if the previous
> line contains 'IV', count over one (or two) tab characters and take the
> next 7 characters (probably rtrim a tab character), convert to numeric,
> exponentiate, and save to write at output. If this is the best way, how do
> I find tab characters?
> Thanks, Gene Maguin
>
>
> Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001
>
> Model A2b; couse2=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257
>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Jon Peck
In reply to this post by Maguin, Eugene
That would probably work.

What are you looking for as output?  Another text file?  A sav file?  Something else?

On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene <[hidden email]> wrote:

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Maguin, Eugene

The idea is to avoid the calculator computation and subsequent typing. I’m going to have a number of these to do and maybe the tradeoff between getting the code to work vs the calculator+typing will favor the former, which will be more interesting to figure out than the latter. I’ll try something tomorrow and see what happens. Thanks.

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 9:45 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

That would probably work.

 

What are you looking for as output?  Another text file?  A sav file?  Something else?

 

On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene <[hidden email]> wrote:

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Maguin, Eugene
In reply to this post by Bruce Weaver
Hi Bruce,
For this particular problem there will be a number of them. Not sure how many; it depends on how the analysis stream evolves. But the however many the layout I showed will be the same, just the variables and the numbers will change. I don't know if you use/have used sas but the default sas output is an html file (.mht) that, as far as I know is uneditable. So I'm already copying and pasting selected lines from the output into word and then using a little office macro magic (just a keyboard macro) to massage the pasted text into the form you see here.
Gene

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver
Sent: Wednesday, June 03, 2020 5:56 PM
To: [hidden email]
Subject: Re: how might I get spss to read this

Hi Gene.  Is this a one-time task involving only the output you've shown?  Or does it have to be repeated multiple times for other sets of output?  I'm just trying to get a sense of how scalable a solution needs to be, how much manual editing can be tolerated, etc.  Thanks.  



Maguin, Eugene wrote

> I've got sas proc gee analysis results that I have tabulated like this.
> The real problem is that sas in its wisdom does not print (or have an
> option in proc gee to print) the odds ratios (OR) when the
> distribution is not normal. Line 1 is a text string with no tabs; line
> 2 and subsequent lines within each summary block are tabbed as shown.
> What I want to do is to read in the summary lines and in the lines
> following line 2, the header line, compute the OR and write it in the
> correct position at output time and then write everything back out so
> that I can swap it with the input text in the word file.
>
> I'm assuming it's impossible to read line 1 as an a80 text string and
> then read lines 2 and 3 with a defined delimiter (tab) and then read
> line 4 as a80. True?
> An alternative is to read all lines as text strings and if the
> previous line contains 'IV', count over one (or two) tab characters
> and take the next 7 characters (probably rtrim a tab character),
> convert to numeric, exponentiate, and save to write at output. If this
> is the best way, how do I find tab characters?
> Thanks, Gene Maguin
>
>
> Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001
>
> Model A2b; couse2=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257
>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the command. To leave the
> list, send the command SIGNOFF SPSSX-L For a list of commands to
> manage subscriptions, send the command INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Bruce Weaver
Administrator
In reply to this post by Maguin, Eugene
Gene, would Word's "convert text to table" be helpful?

https://support.office.com/en-us/article/convert-text-to-a-table-or-a-table-to-text-b5ce45db-52d5-4fe3-8e9c-e04b62f189e1

 


Maguin, Eugene wrote
> The idea is to avoid the calculator computation and subsequent typing. I’m
> going to have a number of these to do and maybe the tradeoff between
> getting the code to work vs the calculator+typing will favor the former,
> which will be more interesting to figure out than the latter. I’ll try
> something tomorrow and see what happens. Thanks.
>
>
> From: Jon Peck [mailto:

> jkpeck@

> ]
> Sent: Wednesday, June 03, 2020 9:45 PM
> To: Maguin, Eugene &lt;

> emaguin@

> &gt;
> Cc: SPSS List &lt;

> SPSSX-L@.uga

> &gt;
> Subject: Re: [SPSSX-L] how might I get spss to read this
>
> That would probably work.
>
> What are you looking for as output?  Another text file?  A sav file?
> Something else?
>
> On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene &lt;

> emaguin@

> &lt;mailto:

> emaguin@

> &gt;> wrote:
> Yes, I’ll be it would be easier to do with python.
> In terms of using char.index to find a tab character, would it work to
> just copy a tab character from word and paste it between apostrophes, like
> this: char.index(line,’tab character’) where tab character is the symbol
> that I have copied?
> Gene Maguin
>
>
> From: Jon Peck [mailto:

> jkpeck@

> &lt;mailto:

> jkpeck@

> &gt;]
> Sent: Wednesday, June 03, 2020 3:06 PM
> To: Maguin, Eugene &lt;

> emaguin@

> &lt;mailto:

> emaguin@

> &gt;>
> Cc: SPSS List &lt;

> SPSSX-L@.uga

> &lt;mailto:

> SPSSX-L@.uga

> &gt;>
> Subject: Re: [SPSSX-L] how might I get spss to read this
>
> You could do this with an INPUT PROGRAM, I think.  It might be easier to
> do it with a little Python, though.
>
> On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene &lt;

> emaguin@

> &lt;mailto:

> emaguin@

> &gt;> wrote:
> I’ve got sas proc gee analysis results that I have tabulated like this.
> The real problem is that sas in its wisdom does not print (or have an
> option in proc gee to print) the odds ratios (OR) when the distribution is
> not normal. Line 1 is a text string with no tabs; line 2 and subsequent
> lines within each summary block are tabbed as shown. What I want to do is
> to read in the summary lines and in the lines following line 2, the header
> line, compute the OR and write it in the correct position at output time
> and then write everything back out so that I can swap it with the input
> text in the word file.
>
> I’m assuming it’s impossible to read line 1 as an a80 text string and then
> read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as
> a80. True?
> An alternative is to read all lines as text strings and if the previous
> line contains ‘IV’, count over one (or two) tab characters and take the
> next 7 characters (probably rtrim a tab character), convert to numeric,
> exponentiate, and save to write at output. If this is the best way, how do
> I find tab characters?
> Thanks, Gene Maguin
>
>
> Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001
>
> Model A2b; couse2=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257
>
> ===================== To manage your subscription to SPSSX-L, send a
> message to

> LISTSERV@.UGA

> &lt;mailto:

> LISTSERV@.UGA

> &gt; (not to SPSSX-L), with no body text except the command. To leave the
> list, send the command SIGNOFF SPSSX-L For a list of commands to manage
> subscriptions, send the command INFO REFCARD
>
>
> --
> Jon K Peck

> jkpeck@

> &lt;mailto:

> jkpeck@

> &gt;
>
>
> --
> Jon K Peck

> jkpeck@

> &lt;mailto:

> jkpeck@

> &gt;
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Maguin, Eugene
Yes, I would do that before reading it with spss. That is a frequently used step when tuning up spss output for presentations (and followed by the conversion back to a table).
Gene

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver
Sent: Thursday, June 04, 2020 8:53 AM
To: [hidden email]
Subject: Re: how might I get spss to read this

Gene, would Word's "convert text to table" be helpful?

https://support.office.com/en-us/article/convert-text-to-a-table-or-a-table-to-text-b5ce45db-52d5-4fe3-8e9c-e04b62f189e1

 


Maguin, Eugene wrote
> The idea is to avoid the calculator computation and subsequent typing.
> I’m going to have a number of these to do and maybe the tradeoff
> between getting the code to work vs the calculator+typing will favor
> the former, which will be more interesting to figure out than the
> latter. I’ll try something tomorrow and see what happens. Thanks.
>
>
> From: Jon Peck [mailto:

> jkpeck@

> ]
> Sent: Wednesday, June 03, 2020 9:45 PM
> To: Maguin, Eugene &lt;

> emaguin@

> &gt;
> Cc: SPSS List &lt;

> SPSSX-L@.uga

> &gt;
> Subject: Re: [SPSSX-L] how might I get spss to read this
>
> That would probably work.
>
> What are you looking for as output?  Another text file?  A sav file?
> Something else?
>
> On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene &lt;

> emaguin@

> &lt;mailto:

> emaguin@

> &gt;> wrote:
> Yes, I’ll be it would be easier to do with python.
> In terms of using char.index to find a tab character, would it work to
> just copy a tab character from word and paste it between apostrophes,
> like
> this: char.index(line,’tab character’) where tab character is the
> symbol that I have copied?
> Gene Maguin
>
>
> From: Jon Peck [mailto:

> jkpeck@

> &lt;mailto:

> jkpeck@

> &gt;]
> Sent: Wednesday, June 03, 2020 3:06 PM
> To: Maguin, Eugene &lt;

> emaguin@

> &lt;mailto:

> emaguin@

> &gt;>
> Cc: SPSS List &lt;

> SPSSX-L@.uga

> &lt;mailto:

> SPSSX-L@.uga

> &gt;>
> Subject: Re: [SPSSX-L] how might I get spss to read this
>
> You could do this with an INPUT PROGRAM, I think.  It might be easier
> to do it with a little Python, though.
>
> On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene &lt;

> emaguin@

> &lt;mailto:

> emaguin@

> &gt;> wrote:
> I’ve got sas proc gee analysis results that I have tabulated like this.
> The real problem is that sas in its wisdom does not print (or have an
> option in proc gee to print) the odds ratios (OR) when the
> distribution is not normal. Line 1 is a text string with no tabs; line
> 2 and subsequent lines within each summary block are tabbed as shown.
> What I want to do is to read in the summary lines and in the lines
> following line 2, the header line, compute the OR and write it in the
> correct position at output time and then write everything back out so
> that I can swap it with the input text in the word file.
>
> I’m assuming it’s impossible to read line 1 as an a80 text string and
> then read lines 2 and 3 with a defined delimiter (tab) and then read
> line 4 as a80. True?
> An alternative is to read all lines as text strings and if the
> previous line contains ‘IV’, count over one (or two) tab characters
> and take the next 7 characters (probably rtrim a tab character),
> convert to numeric, exponentiate, and save to write at output. If this
> is the best way, how do I find tab characters?
> Thanks, Gene Maguin
>
>
> Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001
>
> Model A2b; couse2=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257
>
> ===================== To manage your subscription to SPSSX-L, send a
> message to

> LISTSERV@.UGA

> &lt;mailto:

> LISTSERV@.UGA

> &gt; (not to SPSSX-L), with no body text except the command. To leave
> the list, send the command SIGNOFF SPSSX-L For a list of commands to
> manage subscriptions, send the command INFO REFCARD
>
>
> --
> Jon K Peck

> jkpeck@

> &lt;mailto:

> jkpeck@

> &gt;
>
>
> --
> Jon K Peck

> jkpeck@

> &lt;mailto:

> jkpeck@

> &gt;
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the command. To leave the
> list, send the command SIGNOFF SPSSX-L For a list of commands to
> manage subscriptions, send the command INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Maguin, Eugene
In reply to this post by Jon Peck

Courtesy of google, I see that tab is x09 and I can convert characters to hex by the ahex2 format. The problem now is that I need, I think, to read character and check whether it is x09. I remember that before utf, there was a discussion about converting letters to their asci code and at one point I was looking for non-printing characters and you had a solution the involved pib format. I think that here I need to do this:

 

String Char(a1).

If (char eq string(09,a1) or maybe

If (char eq string(x09,a1) or maybe

If (string(char,ahex2) eq x09) Or something different.

 

 

The other thing to ask is if I read two characters (char is now a2), is it possible to test char against the hex combination, for instance, 0909?  Doing so would be helpful here.

 

Thanks, Gene Maguin

 

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 9:45 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

That would probably work.

 

What are you looking for as output?  Another text file?  A sav file?  Something else?

 

On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene <[hidden email]> wrote:

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <
[hidden email]>
Cc: SPSS List <
[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Jon Peck
Here's a code fragment I have around.

compute strvar = replace(strvar, string(09, pib1),' ').

It removes tab characters, but you could use the string portion in your IF expression. I think you could concatenate that twice to test for two.

On Sat, Jun 6, 2020 at 1:13 PM Maguin, Eugene <[hidden email]> wrote:

Courtesy of google, I see that tab is x09 and I can convert characters to hex by the ahex2 format. The problem now is that I need, I think, to read character and check whether it is x09. I remember that before utf, there was a discussion about converting letters to their asci code and at one point I was looking for non-printing characters and you had a solution the involved pib format. I think that here I need to do this:

 

String Char(a1).

If (char eq string(09,a1) or maybe

If (char eq string(x09,a1) or maybe

If (string(char,ahex2) eq x09) Or something different.

 

 

The other thing to ask is if I read two characters (char is now a2), is it possible to test char against the hex combination, for instance, 0909?  Doing so would be helpful here.

 

Thanks, Gene Maguin

 

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 9:45 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

That would probably work.

 

What are you looking for as output?  Another text file?  A sav file?  Something else?

 

On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene <[hidden email]> wrote:

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <
[hidden email]>
Cc: SPSS List <
[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Jon Peck
In reply to this post by Maguin, Eugene
Here's an example looking for two consecutive tabs.
COMPUTE has2tab=char.index(s, concat(string(09, pib1), string(09, pib1))).

On Sat, Jun 6, 2020 at 1:13 PM Maguin, Eugene <[hidden email]> wrote:

Courtesy of google, I see that tab is x09 and I can convert characters to hex by the ahex2 format. The problem now is that I need, I think, to read character and check whether it is x09. I remember that before utf, there was a discussion about converting letters to their asci code and at one point I was looking for non-printing characters and you had a solution the involved pib format. I think that here I need to do this:

 

String Char(a1).

If (char eq string(09,a1) or maybe

If (char eq string(x09,a1) or maybe

If (string(char,ahex2) eq x09) Or something different.

 

 

The other thing to ask is if I read two characters (char is now a2), is it possible to test char against the hex combination, for instance, 0909?  Doing so would be helpful here.

 

Thanks, Gene Maguin

 

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 9:45 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

That would probably work.

 

What are you looking for as output?  Another text file?  A sav file?  Something else?

 

On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene <[hidden email]> wrote:

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <
[hidden email]>
Cc: SPSS List <
[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

Maguin, Eugene

Jon,

Thank you very much for your help on this problem. I couldn’t have done it otherwise.

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Saturday, June 06, 2020 5:55 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

Here's an example looking for two consecutive tabs.

COMPUTE has2tab=char.index(s, concat(string(09, pib1), string(09, pib1))).

 

On Sat, Jun 6, 2020 at 1:13 PM Maguin, Eugene <[hidden email]> wrote:

Courtesy of google, I see that tab is x09 and I can convert characters to hex by the ahex2 format. The problem now is that I need, I think, to read character and check whether it is x09. I remember that before utf, there was a discussion about converting letters to their asci code and at one point I was looking for non-printing characters and you had a solution the involved pib format. I think that here I need to do this:

 

String Char(a1).

If (char eq string(09,a1) or maybe

If (char eq string(x09,a1) or maybe

If (string(char,ahex2) eq x09) Or something different.

 

 

The other thing to ask is if I read two characters (char is now a2), is it possible to test char against the hex combination, for instance, 0909?  Doing so would be helpful here.

 

Thanks, Gene Maguin

 

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 9:45 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

That would probably work.

 

What are you looking for as output?  Another text file?  A sav file?  Something else?

 

On Wed, Jun 3, 2020 at 2:16 PM Maguin, Eugene <[hidden email]> wrote:

Yes, I’ll be it would be easier to do with python.

In terms of using char.index to find a tab character, would it work to just copy a tab character from word and paste it between apostrophes, like this: char.index(line,’tab character’) where tab character is the symbol that I have copied?

Gene Maguin

 

 

From: Jon Peck [mailto:[hidden email]]
Sent: Wednesday, June 03, 2020 3:06 PM
To: Maguin, Eugene <
[hidden email]>
Cc: SPSS List <
[hidden email]>
Subject: Re: [SPSSX-L] how might I get spss to read this

 

You could do this with an INPUT PROGRAM, I think.  It might be easier to do it with a little Python, though.

 

On Wed, Jun 3, 2020 at 11:56 AM Maguin, Eugene <[hidden email]> wrote:

I’ve got sas proc gee analysis results that I have tabulated like this. The real problem is that sas in its wisdom does not print (or have an option in proc gee to print) the odds ratios (OR) when the distribution is not normal. Line 1 is a text string with no tabs; line 2 and subsequent lines within each summary block are tabbed as shown. What I want to do is to read in the summary lines and in the lines following line 2, the header line, compute the OR and write it in the correct position at output time and then write everything back out so that I can swap it with the input text in the word file.

 

I’m assuming it’s impossible to read line 1 as an a80 text string and then read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as a80. True?

An alternative is to read all lines as text strings and if the previous line contains ‘IV’, count over one (or two) tab characters and take the next 7 characters (probably rtrim a tab character), convert to numeric, exponentiate, and save to write at output. If this is the best way, how do I find tab characters?

Thanks, Gene Maguin

 

 

Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001

 

Model A2b; couse2=dsa1 Went out(Yes=1, No=2)

IV             Val  Estimate SE      95%L     95%U     Z       sig      OR

Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: how might I get spss to read this

PRogman
In reply to this post by Maguin, Eugene
This syntax reads the textfile with the 3 rows with row 1 as string, row 2
variable names, and row 3 values. Row 4 is skipped. I assume the model A2a
has 2 tab characters between Dsa1 and the estimate value. Note that Sig is a
string (contains '<').
Now do some data juggling and write a new file.
You need to adjust the fnTextData to your path and file name.

HTH, PR

*****************.
FILE HANDLE fnTextData /NAME = '%userprofile%\Desktop\SAS_gee_results.txt' .

NEW FILE.
PRESERVE.
SET DECIMAL = DOT.
FILE TYPE MIXED
  FILE   = 'fnTextData'
  RECORD = RowID 1 (A).

RECORD TYPE 'M'.
DATA LIST LIST (TAB) / Model (A80) .

RECORD TYPE 'I'.
DATA LIST FREE (TAB) / Var1 (A8) Var2 (A8) Var3 (A8) Var4 (A8) Var5 (A8)
Var6 (A8) Var7 (A8) Var8 (A8) Var9 (A8).

RECORD TYPE 'D'.
DATA LIST FREE (TAB) / IV (A8) Val (F8.0) Estimate (F8.4) SE (F8.4) CI95L
(F8.4) CI95U (F8.4) Z (F8.4) Sig (A8).

END FILE TYPE.
RESTORE.
EXECUTE.
DO REPEAT r =  Model Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9.
  IF (r EQ "") r = LAG(r).
END REPEAT.
EXECUTE.
SELECT IF (RowID EQ 'D').
EXECUTE.
DELETE VARIABLES RowID /* Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 */.

*data juggling*.

WRITE /*OUTFILE =   */
 /1 Model
 /2 "IV       Val      Estimate  SE      95%L     95%U    Z         sig      
OR"
 /3 IV Val Estimate SE CI95L CI95U Z '  ' Sig
 /4.
EXECUTE.
*****************.



Maguin, Eugene wrote

> I've got sas proc gee analysis results that I have tabulated like this.
> The real problem is that sas in its wisdom does not print (or have an
> option in proc gee to print) the odds ratios (OR) when the distribution is
> not normal. Line 1 is a text string with no tabs; line 2 and subsequent
> lines within each summary block are tabbed as shown. What I want to do is
> to read in the summary lines and in the lines following line 2, the header
> line, compute the OR and write it in the correct position at output time
> and then write everything back out so that I can swap it with the input
> text in the word file.
>
> I'm assuming it's impossible to read line 1 as an a80 text string and then
> read lines 2 and 3 with a defined delimiter (tab) and then read line 4 as
> a80. True?
> An alternative is to read all lines as text strings and if the previous
> line contains 'IV', count over one (or two) tab characters and take the
> next 7 characters (probably rtrim a tab character), convert to numeric,
> exponentiate, and save to write at output. If this is the best way, how do
> I find tab characters?
> Thanks, Gene Maguin
>
>
> Model A2a; couse0_12=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1                -1.7363  0.1218  -1.9751  -1.4976  -14.25  <.0001
>
> Model A2b; couse2=dsa1 Went out(Yes=1, No=2)
> IV             Val  Estimate SE      95%L     95%U     Z       sig      OR
> Dsa1           1    0.6570   0.2945  0.0798   1.2343   2.23    0.0257
>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD