Hi,
I'm trying to capture a correlation matrix using OMS and then, for simplicity say, recode the ones in diagonal as sysmiss. However to do this I must know the variable names OMS decides to name them. As far as I am aware there is no option to allow any particular preference of the users choice? As it currently stands it concatenates the variable name and variable label. However this is extremely difficult to code within to a macro so that I can specify the variables on my RECODE command.
sample code:
get file ='C:\Program Files (x86)\SPSS\employee data.sav'.
dataset name MyActiveDS.
preserve. set tnumbers=both tvars=both.
dataset declare dsCorrs. oms /select tables /if commands = ["correlations"] subtypes = ["correlations"] /destination format = sav numbered = tablenumber_ outfile = dsCorrs /tag="dsCorrs". correl bdate educ jobcat salary salbegin jobtime prevexp minority.
omsend tag=["dsCorrs"].
restore. Setting the variable labels off (set tvars=name) is not an option as it would remove the variable labels from the rows also, which is no good.
Any suggestion?
Many thanks in advance.
Jignesh
|
I will be out of office till Jan. 3, 2011. I will have very limited access to email. If you need immediate assistance please contact 479-575-2905.
Thank you. |
In reply to this post by Jignesh Sutar
see if this untested syntax does what you want. (be sure to check
whether there are off diagonal 1.00s. dataset activate dscorrs. missing data all (1.00). That way you can avoid misuse of sysmis and procedures will still process those values as missing. Just curious what procedures are you doing that cannot deal with 1.00 on the diagonal? Art Kendall Social Research Consultants On 12/7/2010 2:42 PM, J Sutar wrote: > Hi, > I'm trying to capture a correlation matrix using OMS and then, for > simplicity say, recode the ones in diagonal as sysmiss. However to do > this I must know the variable names OMS decides to name them. As far > as I am aware there is no option to allow any particular preference of > the users choice? As it currently stands it concatenates the variable > name and variable label. However this is extremely difficult to code > within to a macro so that I can specify the variables on my RECODE > command. > sample code: > get file ='C:\Program Files (x86)\SPSS\employee data.sav'. > dataset name MyActiveDS. > > preserve. > set tnumbers=both tvars=both. > dataset declare dsCorrs. > oms > /select tables > /if commands = ["correlations"] > subtypes = ["correlations"] > /destination format = sav numbered = tablenumber_ > outfile = dsCorrs /tag="dsCorrs". > correl bdate educ jobcat salary salbegin jobtime prevexp minority. > omsend tag=["dsCorrs"]. > restore. > Setting the variable labels off (set tvars=name) is not an option as > it would remove the variable labels from the rows also, which is no good. > Any suggestion? > Many thanks in advance. > Jignesh ===================== 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
Art Kendall
Social Research Consultants |
In reply to this post by Jignesh Sutar
You can't specify the names in the OMS
dataset. You could get close by just renaming the variables after
the OMS dataset is created, e.g.,
rename variables (var1 to minorityclassification = v5 to v14). Of course, with programmability this would be trivial to do. If the purpose is to improve the presentation of the correlation table, you might be interested in the FormatCorrelations extension command with dialog box available from Developer Central. HTH, Jon Peck Senior Software Engineer, IBM [hidden email] 312-651-3435 From: J Sutar <[hidden email]> To: [hidden email] Date: 12/07/2010 12:58 PM Subject: [SPSSX-L] OMS convention of naming variables (of table columns) Sent by: "SPSSX(r) Discussion" <[hidden email]> Hi, I'm trying to capture a correlation matrix using OMS and then, for simplicity say, recode the ones in diagonal as sysmiss. However to do this I must know the variable names OMS decides to name them. As far as I am aware there is no option to allow any particular preference of the users choice? As it currently stands it concatenates the variable name and variable label. However this is extremely difficult to code within to a macro so that I can specify the variables on my RECODE command. sample code: get file ='C:\Program Files (x86)\SPSS\employee data.sav'. dataset name MyActiveDS. preserve. set tnumbers=both tvars=both. dataset declare dsCorrs. oms /select tables /if commands = ["correlations"] subtypes = ["correlations"] /destination format = sav numbered = tablenumber_ outfile = dsCorrs /tag="dsCorrs". correl bdate educ jobcat salary salbegin jobtime prevexp minority. omsend tag=["dsCorrs"]. restore. Setting the variable labels off (set tvars=name) is not an option as it would remove the variable labels from the rows also, which is no good. Any suggestion? Many thanks in advance. Jignesh |
Free forum by Nabble | Edit this page |