|
The census now allows respondents to identify with more than one "race" or
ethnicity. In order to measure compliance with norms on service to minorities, Federal indicators sometimes use the term "non-minority" individuals for individuals who report themselves exclusively as White, non-Hispanic) (Definition of ``Non-minority Individual'' [34 CFR Part 361.81])." In my data, "race" or ethnicity are either designated by a "1" (Yes), or by a letter designating a subgroup (Variables HISPAN, ASIAN, HAWN, BLACK, INDIAN, and WHITE. Both ASIAN and HAWN may be coded with a letter corresponding to a subgroup.) If the individual is not associated with a race or ethnicity, the space is usually left blank. This means that some variables are numeric, and others are character variables. And of course it means that for numeric variables like INDIAN and WHITE, if the individual was not Indian, leaving the field blank would result in the field being read as "0", right? I wrote some kludgy syntax trying to define a variable "MINORITY" to have the value "WHITE" for individuals who report themselves exclusively as White, and non-Hispanic, or by some other descriptive label if the person identified with any non-White race or ethnicity. I seemed to run into trouble if I tried to include the INDIAN designation in with the others. I think there may be other errors in the syntax provided below, as well. I would be grateful for any assistance detecting logical errors or syntax errors, and would also be grateful for simpler syntax. STRING MINORITY (A8). COMPUTE MINORITY = ' '. DO IF (HISPAN = '1' ). COMPUTE MINORITY = 'HISPANIC'. ELSE IF (ASIAN NE ' '). COMPUTE MINORITY = 'ASIAN'. ELSE IF (HAWN NE ' '). COMPUTE MINORITY = 'HAWN/PI'. ELSE IF (BLACK = 1). COMPUTE MINORITY = 'BLACK'. END IF. /*Note that if BLACK is undefined, any other ELSE IFs placed after the COMPUTE statement will not be read, and the DO exits to the END IF. /*For this reason, the numeric fields must be handled separately. DO IF (INDIAN = 1). COMPUTE MINORITY = 'INDIAN'. END IF. DO IF (MINORITY = ' ' AND WHITE = 1). COMPUTE MINORITY = 'WHITE'. END IF. CROSSTABS /TABLES=STAT BY MINORITY /FORMAT= AVALUE TABLES /CELLS= COUNT /COUNT ROUND CELL . Bob Schacht Robert M. Schacht, Ph.D. <[hidden email]> Pacific Basin Rehabilitation Research & Training Center 1268 Young Street, Suite #204 Research Center, University of Hawaii Honolulu, HI 96814 ===================== 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 |
|
Hi Bob,
Since you did not include a datalist, I am not sure that my datalist equals yours. I did not understand the logic in your code, so I wrote a new one, that perhaps is easier to read. * Combining string and numeric variables. * Example written by Eero Olli 13.08.2008 for SPSS-X. * based on problem given by Bob Schacht. DATA LIST LIST (",") / hispan (a12) asian (a12) hawn (a12) black (f8.0) indian (f8.0) white (f8.0) . BEGIN DATA Mexican , , ,1, , ,Korean , , , , , ,Maori , , ,1 , , ,1, , , , , ,1 , , , , ,1,1 , , , , ,1 Cuban ,Korean , ,1, , END DATA. LIST. DATASET NAME raceANDethnicity WINDOW=FRONT. * Identify the non-white minorities (combine strings and numbers to one numeric). IF LENGTH(RTRIM(hispan))>0 minority_dummy=1. IF LENGTH(RTRIM(asian))>0 minority_dummy=1. IF LENGTH(RTRIM(hawn))>0 minority_dummy=1. * numeric variables can be evaluated in groups . IF ANY(1, black TO indian) minority_dummy=1. * I believe the code above is sufficient to identify minorities. * the rest is dependent of how one understands and classifies race and ethnicity. * I have only marginal knowledge of how these issues are officially dealt with in US. * Make two string variables that show how complex racial and ethnic identities are. * that is combine strings and numeric to strings. STRING black_str indian_str white_str hispanic_str asian_str hawn_str (A20). IF black=1 black_str= "black". IF indian = 1 indian_str="indian". IF white = 1 white_str="white". * it is also nice to keep the country background that is available, while labeling them. IF LENGTH(RTRIM(hispan))>0 hispanic_str = CONCAT("hispanic (",RTRIM(hispan), ")"). IF LENGTH(RTRIM(asian))>0 asian_str = CONCAT("asian (", RTRIM(asian), ")" ). IF LENGTH(RTRIM(hawn))>0 hawn_str = CONCAT("hawaian (", RTRIM(hawn), ")"). * and then we put it all together. information concerning whitenes is not included. STRING minority (A100). COMPUTE minority = LTRIM(CONCAT( RTRIM(black_str), " ", RTRIM(indian_str), " ", RTRIM(hispanic_str), " ", RTRIM(asian_str), " ", RTRIM(hawn_str) ) ) . * same but including whites. STRING background (A100). COMPUTE background = LTRIM(CONCAT( RTRIM(white_str), " ", RTRIM(black_str), " ", RTRIM(indian_str), " ", RTRIM(hispanic_str), " ", RTRIM(asian_str), " ", RTRIM(hawn_str) ) ) . * minorities stay minorities, and whites are whites. * notice how missing values can be used to exclude values. IF LENGTH(RTRIM(minority))>0 & white<>1 white = 0. VALUE LABEL white 1 'white' 0 'non-white' . MISSING VALUES white (0). * can you be white and belong to minority?... of course, I think. IF white=1 race=1. IF minority_dummy=1 race=3. * the combination must be the last in the sequence. IF white = 1 AND minority_dummy = 1 race=2. VALUE LABELS race 1 'white' 2 'white minority' 3 'non-white minority'. EXECUTE. FREQ ALL. ------------------------------ Date: Fri, 8 Aug 2008 14:50:20 -1000 From: Bob Schacht <[hidden email]> Subject: "Race/ethnicity" variable ===================== 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 |
|
Does SPSS provide a a pseudo F statistic associated with cluster solutions of different sizes to help determine the optimal number of clusters similar to SAS fastclus? Also, any insights on on how the algorithms of SAS's fastclus versus SPSS's K-means methodology compare/contrast would be greatly appreciated. Thanks! Taylor ====================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 |
| Free forum by Nabble | Edit this page |
