AW: WRITE OUTFILE

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

AW: WRITE OUTFILE

Georg Maubach
Hi Tom,

You are on the right track. Try

WRITE OUTFILE = 'c:/abc.sps' / " This is a string value: ", RTRIM(strVar) .

Regards

Georg Maubach


-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von Tom Guston
Gesendet: Dienstag, 14. August 2007 17:47
An: [hidden email]
Betreff: WRITE OUTFILE

Hi
How can I WRITE the string variable strVar to OUTFILE without the right padding to strVar's format length?

compute strVar = rtrim(strVar) doesn't do the trick before the WRITE statement, nor does the use of FORMATS.

WRITE OUTFILE = 'c:/abc.sps' / " This is a string value: ", strVar.

Thank you.

Tom.
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Reply | Threaded
Open this post in threaded view
|

Re: WRITE OUTFILE

Richard Ristow
I'm afraid I didn't get the original message, or didn't get it yet; I'm
working from George Maubach's reply.

Anyway, Dienstag, 14. August 2007 17:47 Tom Gunston had asked,

>>How can I WRITE the string variable strVar to OUTFILE without the
>>right padding to strVar's format length?

Alas, I don't know a way. The best I can say is, write the file, then
use an editor or program that removes trailing blanks.

If you tell SPSS to write the string variable, it writes the string
variable; from its point of view, the blanks at the end are as much a
part of the variable as any other characters.

>>compute strVar = rtrim(strVar) doesn't do the trick

No, it won't. In fact, that COMPUTE has no effect at all. It computes a
string value, 'rtrim(strvar), that doesn't have the trailing blanks;
but the length of the variable 'strvar' can't change, and when you
assign the value to 'strvar', it's padded back to 'strvar's length,
with trailing blanks.

>>...  nor does the use of FORMATS.

Nope, not that, either. You probably found that you could only use an A
format that specified the string's exact length. Even if you could
specify a shorter format, you'd truncate to a fixed length, rather than
the length with trailing blanks dropped. (See note at the end of this
posting, though.)

At 12:54 PM 8/14/2007, Georg Maubach suggested:

>Try
>
>WRITE OUTFILE = 'c:/abc.sps' / " This is a string value: ",
>RTRIM(strVar) .

That's a good idea, but it won't work. WRITE and PRINT only write the
values of variables, or string constants. Here's SPSS 15 draft output,
using PRINT instead of WRITE:

COMPUTE Length = LENGTH(RTRIM(Text)).
LIST.

List
|-----------------------------|---------------------------|
|Output Created               |15-AUG-2007 00:11:15       |
|-----------------------------|---------------------------|
LineNum Length Text

     1       3  ABC
     2       6  ABCDEF
     3       9  ABCDEFGHI

Number of cases read:  3    Number of cases listed:  3


ECHO  'Printing the variables as they are:'.
Printing the variables as they are:
PRINT /
    'Line ' LineNum(F3) ', length ' Length(F3)': ' Text.
EXECUTE.
Line   1, length   3: ABC
Line   2, length   6: ABCDEF
Line   3, length   9: ABCDEFGHI

ECHO  'Printing the text using RTRIM:'.
Printing the text using RTRIM:
PRINT /
    'Line ' LineNum(F3) ', length ' Length(F3)': ' RTRIM(Text).

 >Error # 4285 in column 51.  Text: RTRIM
 >Incorrect variable name: either the name is more than 64 characters,
or it
 >is not defined by a previous command.
 >This command not executed.

EXECUTE.
.................
The note I promised:

You can effectively truncate a string variable to a shorter fixed
length for PRINT or WRITE, by assigning it to a scratch variable of the
desired, shorter length, and printing that:

ECHO  'Truncating to five letters:'.
Truncating to five letters:

STRING   #5Ltrs (A5).
COMPUTE  #5Ltrs = Text

PRINT /
    'Line ' LineNum(F3) ', length ' Length(F3)': ' #5Ltrs.
EXECUTE.
Line   1, length   3: ABC
Line   2, length   6: ABCDE
Line   3, length   9: ABCDE
Reply | Threaded
Open this post in threaded view
|

Re: WRITE OUTFILE

Tom Guston
In reply to this post by Georg Maubach
Thank you for your replies. I've tried the following steps (strongly 'inspired' from www.spsstools.net, thanks to R. Levesque) to somewhat control the string length sent to file: 1) identify longest 'actual' length of field levels...COMPUTE len = LENGTH(RTRIM(levels))....IF len LT LAG(len) len = LAG(len).COMPUTE dummy = 1.MATCH FILES FILE = * / BY = dummy / LAST = bot.EXECUTE. 2) create tmp.sps file with max levels length hard coded in syntax...STRING tmp(A5).DO IF bot.+ COMPUTE tmp = CONCAT(RTRIM('(A'),LTRIM(RTRIM(STRING(len,F3.0))),')').+ WRITE OUTFILE = 'c:/temp/tmp.sps' / 'STRING trimmedLevels ', tmp, '.' .+ WRITE OUTFILE = 'c:/temp/tmp.sps' / 'COMPUTE trimmedLevels = RTRIM(levels).'.END IF.EXECUTE.... 3) insert tmp.sps, rename trimmedLevels to levels and carry on. Tom.
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
Reply | Threaded
Open this post in threaded view
|

WG: WRITE OUTFILE

Georg Maubach
In reply to this post by Georg Maubach
Hi Tom,

Please excuse me for sending you on the wrong track. I very sorry.

Regards

Georg Maubach


-----Ursprüngliche Nachricht-----
Von: Maubach, Georg BC/MRSC
Gesendet: Dienstag, 14. August 2007 18:55
An: 'Tom Guston'; [hidden email]
Betreff: AW: WRITE OUTFILE

Hi Tom,

You are on the right track. Try

WRITE OUTFILE = 'c:/abc.sps' / " This is a string value: ", RTRIM(strVar) .

Regards

Georg Maubach


-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von Tom Guston
Gesendet: Dienstag, 14. August 2007 17:47
An: [hidden email]
Betreff: WRITE OUTFILE

Hi
How can I WRITE the string variable strVar to OUTFILE without the right padding to strVar's format length?

compute strVar = rtrim(strVar) doesn't do the trick before the WRITE statement, nor does the use of FORMATS.

WRITE OUTFILE = 'c:/abc.sps' / " This is a string value: ", strVar.

Thank you.

Tom.
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Reply | Threaded
Open this post in threaded view
|

reporting regular vs standardized betas

Zdaniuk, Bozena
Hello, my impression is that people usually report regular beta
coefficients in literature. However, are there any circumstances under
which it would make more sense to report standardized betas instead?
(e.g., very diverse measuring units among the IV's in equation) And if
yes, can they be reported alone or should they always be accompanied by
the original betas as well? Any opinions on that?
Thanks.
Bozena

Bozena Zdaniuk, Ph.D.

University of Pittsburgh

UCSUR, 6th Fl.

121 University Place

Pittsburgh, PA 15260

Ph.: 412-624-5736

Fax: 412-624-4810

email: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: reporting regular vs standardized betas

Swank, Paul R
1. Standardized coefficients are not as stable under sampling as raw
coefficients.
2. Standardized coefficients do not tell you for sure whether on
variable is "more important than another".
3. If all the data meets all the assumptions, including that the
predictors are measured without error, and there are no outliers or
overly influential data points, which might happen but is very unlikely.


Therefore, you should report raw coefficients and if you also give
standardized ones, you should not over-interpret them.

Paul R. Swank, Ph.D. Professor
Director of Reseach
Children's Learning Institute
University of Texas Health Science Center-Houston


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Zdaniuk, Bozena
Sent: Wednesday, August 15, 2007 1:44 PM
To: [hidden email]
Subject: reporting regular vs standardized betas

Hello, my impression is that people usually report regular beta
coefficients in literature. However, are there any circumstances under
which it would make more sense to report standardized betas instead?
(e.g., very diverse measuring units among the IV's in equation) And if
yes, can they be reported alone or should they always be accompanied by
the original betas as well? Any opinions on that?
Thanks.
Bozena

Bozena Zdaniuk, Ph.D.

University of Pittsburgh

UCSUR, 6th Fl.

121 University Place

Pittsburgh, PA 15260

Ph.: 412-624-5736

Fax: 412-624-4810

email: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: reporting regular vs standardized betas

Burleson,Joseph A.
In reply to this post by Zdaniuk, Bozena
1. Standardized coefficients allow one to measure the relative variance
among a set of (potentially) differentialy scaled variables withing the
same study.
2. Unstandardized coefficients allow one to compare the same independent
measure (assuming the same dependent measure, also) from one study to
the next.

3. Both are equally "reliable" in that each has its own SE.

Joe Burleson

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Zdaniuk, Bozena
Sent: Wednesday, August 15, 2007 2:44 PM
To: [hidden email]
Subject: reporting regular vs standardized betas

Hello, my impression is that people usually report regular beta
coefficients in literature. However, are there any circumstances under
which it would make more sense to report standardized betas instead?
(e.g., very diverse measuring units among the IV's in equation) And if
yes, can they be reported alone or should they always be accompanied by
the original betas as well? Any opinions on that?
Thanks.
Bozena

Bozena Zdaniuk, Ph.D.

University of Pittsburgh

UCSUR, 6th Fl.

121 University Place

Pittsburgh, PA 15260

Ph.: 412-624-5736

Fax: 412-624-4810

email: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: reporting regular vs standardized betas

David Hitchin
In reply to this post by Zdaniuk, Bozena
Quoting "Zdaniuk, Bozena" <[hidden email]>:

> Hello, my impression is that people usually report regular beta
> coefficients in literature. However, are there any circumstances
> under which it would make more sense to report standardized betas
> instead?

There is a lot of confusion in published papers about terminology. I
suggest that the SPSS convention is a good one to follow:

1) "Regular beta coefficients" (unstandardized regression coefficients)
are "B"

2) The word "Beta" is reserved for standardised regression coefficients.

David Hitchin
Reply | Threaded
Open this post in threaded view
|

Re: reporting regular vs standardized betas

Swank, Paul R
What is really confusing is that, by rights, beta should be the
population partial regression coefficient.

Paul R. Swank, Ph.D. Professor
Director of Reseach
Children's Learning Institute
University of Texas Health Science Center-Houston

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
David Hitchin
Sent: Wednesday, August 15, 2007 3:41 PM
To: [hidden email]
Subject: Re: reporting regular vs standardized betas

Quoting "Zdaniuk, Bozena" <[hidden email]>:

> Hello, my impression is that people usually report regular beta
> coefficients in literature. However, are there any circumstances under

> which it would make more sense to report standardized betas instead?

There is a lot of confusion in published papers about terminology. I
suggest that the SPSS convention is a good one to follow:

1) "Regular beta coefficients" (unstandardized regression coefficients)
are "B"

2) The word "Beta" is reserved for standardised regression coefficients.

David Hitchin
Reply | Threaded
Open this post in threaded view
|

Re: reporting regular vs standardized betas

David Hitchin
Quoting "Swank, Paul R" <[hidden email]>:

>
> What is really confusing is that, by rights, beta should be the
> population partial regression coefficient.

Agreed.

If only the subject of statistics had been founded by an authoritative
group which allocated consistent symbols and sensible technical terms.

Unfortunately we have "significance", "regression" "analysis of
variance" (which is really the analysis of means), "correlation",
"principal components" (meaning either an orthogonal rotation without
rescaling to maximise variance along successive axes or else a variety
of factor analysis), and "error".

Perhaps part of the problem is the difficulty, once more acute than now,
of adding "hats" to computer printouts and word processed documents.

So, SPSS might have labelled its unstandardised regression coefficients
as Beta-hat and chosen some other term for standardised coefficients -
but they didn't!

As this list is for SPSS users, I'm inclined to stick with their
terminology. All too often people using SPSS output refer to "betas"
when they mean the unstandardised coefficients, and without saying that
they have deviated from SPSS terminology.

David Hitchin
Reply | Threaded
Open this post in threaded view
|

Re: reporting regular vs standardized betas

Hector Maletta
         In this matter, as in many others, a Humpty Dumpty theory of
language reigns: words mean what we want them to mean. And we often don't
even bother to define them in advance. If only we could all agree on one
meaning for each word that would be fine. That's the nag with Humpty
Dumpty's theory, you know. In the meantime, one should always clarify what
is meant by each symbol, tiresome as it might be.

         Hector

         -----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
David Hitchin
Sent: 16 August 2007 13:51
To: [hidden email]
Subject: Re: reporting regular vs standardized betas

         Quoting "Swank, Paul R" <[hidden email]>:

         >
         > What is really confusing is that, by rights, beta should be the
         > population partial regression coefficient.

         Agreed.

         If only the subject of statistics had been founded by an
authoritative
         group which allocated consistent symbols and sensible technical
terms.

         Unfortunately we have "significance", "regression" "analysis of
         variance" (which is really the analysis of means), "correlation",
         "principal components" (meaning either an orthogonal rotation
without
         rescaling to maximise variance along successive axes or else a
variety
         of factor analysis), and "error".

         Perhaps part of the problem is the difficulty, once more acute than
now,
         of adding "hats" to computer printouts and word processed
documents.

         So, SPSS might have labelled its unstandardised regression
coefficients
         as Beta-hat and chosen some other term for standardised
coefficients -
         but they didn't!

         As this list is for SPSS users, I'm inclined to stick with their
         terminology. All too often people using SPSS output refer to
"betas"
         when they mean the unstandardised coefficients, and without saying
that
         they have deviated from SPSS terminology.

         David Hitchin