|
Hello to everybody?
I've got a Problem: I've different ordinal variables with 4 categories, which shoukd be ranked. There is a given Priorisation (say from 1 to 10). So it is no surprise that there a lot of ties. But how can I give a ascending numbers to these ties: e.g.: v1 ranks WANTED 4 14 5 4 14 15 4 14 16 4 14 17 4 14 18 3 9 9 2 4 4 1 1 1 3 9 10 2 4 5 1 1 2 1 1 3 2 4 6 2 4 7 2 4 8 3 9 11 3 9 12 4 14 19 3 9 13 4 14 20 Using Excel i can do this without problems *=RANG(B1; B$1:B$20; 1) + ZÃHLENWENN(B$1:B1; B1) - 1 Does someone give me a hint, how do this with SPSS. Additionaly I've got some missings. Thank you Peter Müller |
|
Hi Peter
You wrote: I've different ordinal variables with 4 categories, which shoukd be ranked. There is a given Priorisation (say from 1 to 10). So it is no surprise that there a lot of ties. But how can I give a ascending numbers to these ties: e.g.: v1 ranks WANTED 4 14 5 4 14 15 4 14 16 4 14 17 4 14 18 3 9 9 2 4 4 1 1 1 3 9 10 2 4 5 1 1 2 1 1 3 2 4 6 2 4 7 2 4 8 3 9 11 3 9 12 4 14 19 3 9 13 4 14 20 Using Excel i can do this without problems *=RANG(B1; B$1:B$20; 1) + ZÄHLENWENN(B$1:B1; B1) - 1 Does someone give me a hint, how do this with SPSS. Additionaly I've got some missings. A couple of questions: - I think there is a typo error in your example. Shouldn't first "wanted"data be 14 instead of 5? - Second question: what do you plan to do with missing data: ignore them, rank them as lowest values or hightes values? Assuming there really is a typo error, and 5 should be 14 in first row, here is a solution using MATRIX (I was going to use RANK /CONDENSE procedure, but it is not giving the expected results). data list list/v1 WANTED (3 F8). begin data 4 5 4 15 4 16 4 17 4 18 3 9 2 4 1 1 3 10 2 5 1 2 1 3 2 6 2 7 2 8 3 11 3 12 4 19 3 13 4 14 20 end data. * No missing data *. CACHE. EXE. MATRIX. GET data /VAR=v1. COMPUTE Ranked=GRADE(data). COMPUTE vname={'Ranked'}. SAVE Ranked /NAMES=vname /OUTFILE='C:\Temp\RankedData.sav'. END MATRIX. MATCH FILES /FILE=* /FILE='C:\Temp\RankedData.sav'. FORMAT Ranked(F8). LIST. * Missing data are ommited *. CACHE. EXE. MATRIX. GET data /VAR=v1 /MISSING=ACCEPT /SYSMIS=100. COMPUTE Ranked=GRADE(data). COMPUTE vname={'Ranked'}. SAVE Ranked /NAMES=vname /OUTFILE='C:\Temp\RankedData.sav'. END MATRIX. MATCH FILES /FILE=* /FILE='C:\Temp\RankedData.sav'. IF MISSING(ranks) Ranked=ranks. FORMAT Ranked(F8). LIST. * Missing data are treated as very low answers *. CACHE. EXE. MATRIX. GET data /VAR=v1 /MISSING=ACCEPT /SYSMIS=0. COMPUTE Ranked=GRADE(data). COMPUTE vname={'Ranked'}. SAVE Ranked /NAMES=vname /OUTFILE='C:\Temp\RankedData.sav'. END MATRIX. MATCH FILES /FILE=* /FILE='C:\Temp\RankedData.sav'. FORMAT Ranked(F8). LIST. * Missing data are treated as very high answers *. CACHE. EXE. MATRIX. GET data /VAR=v1 /MISSING=ACCEPT /SYSMIS=100. COMPUTE Ranked=GRADE(data). COMPUTE vname={'Ranked'}. SAVE Ranked /NAMES=vname /OUTFILE='C:\Temp\RankedData.sav'. END MATRIX. MATCH FILES /FILE=* /FILE='C:\Temp\RankedData.sav'. FORMAT Ranked(F8). LIST. Regards, Marta Garcia-Granero |
|
Hi, I have to do a survival analysis or time-to-event analysis and in my data some variables are fixed (i.e. gender) and in other variables their values change over time (i.e. CD4). I've heard that Cox regression analysis with time-dependent covariates is the appropiate statistical procedure for this kind of analysis. So, I'm looking for examples in SPSS and guidelines about this procedure. Unfortunately, in my study, I have some missing data for some time-dependent variables. So in these cases, what is the most common solution? imputation methods? or just not to use these variables at all. Thanks in advance for your comments and suggestions, /Christian |
|
Christian,
If your study is longitudinal, you probably mean that for a certain subject you have a missing value for covariate k at time t, but you have a valid value at times t-1 and t+1 (and other times as well. If that is the case, and the number of such missing values is not too large, I do not see much to worry: either you interpolate the missing value (assuming the variable in question shows a more or less regular pattern over time, and you have the adjacent values for t-1 and t+1) or you leave it blank for that particular point in time and that particular subject. In the latter option, that subject will be included in the analysis but the observation of that subject at time t will not be included. Of course, if you have a large number of missing points, you may be in trouble, because they would reduce the overall number of observation points, possibly in a biased manner. Hector _____ From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Christian Bautista Sent: 07 October 2007 15:26 To: [hidden email] Subject: Survival analysis (time-to-event analysis) Importance: High Hi, I have to do a survival analysis or time-to-event analysis and in my data some variables are fixed (i.e. gender) and in other variables their values change over time (i.e. CD4). I've heard that Cox regression analysis with time-dependent covariates is the appropiate statistical procedure for this kind of analysis. So, I'm looking for examples in SPSS and guidelines about this procedure. Unfortunately, in my study, I have some missing data for some time-dependent variables. So in these cases, what is the most common solution? imputation methods? or just not to use these variables at all. Thanks in advance for your comments and suggestions, /Christian |
| Free forum by Nabble | Edit this page |
