Hola expertos en SPSS
Espero que esta Semana Santa haya sido de mucha reflexion y de descanso reparador para iniciar sus actividades con animos, en estos días me ha tocado que realizar un trabajo de tablas dinamicas con subtotales y totales por marca, pero no lo he podido generar de forma automatica, y quisiera ver si hay alguna sugerencia para poder generar esta tabla, mi problema es el siguiente:
en mi base de datos tengo una pregunta que reza así: Que marcas de Sancks conoce? RM
y tengo este listado de codigos como este (Ej):
si notan en el listado los codigos 08 y 09 son de la misma marca pero diferente presentación, lo mismo pasa con los codigos 15, 16 y 17, tambien con 22 y 23.
entonces yo tengo que generara una tabla que me indique el sub-total de los codigos 8 y 9 y un total de toda la marca madre Bocadeli que incluya los codigos 1 al 10, todo esto sin duplicar la información, ya que un entrevistado pude mencionar varias presentaciónes de una misma marca.
esta es la forma en como lo he tratado de generar sin exito. Ojo: esta tabla es para cat. de cereales pero es el mismo caso. * Tablas personalizadas. CTABLES /FORMAT EMPTY=' -' MISSING='.' /SMISSING VARIABLE /VLABELS VARIABLES=p1 year Seis_Meses Dic2013_3Mes Ene2014_3Mes Feb2014_3Mes DISPLAY=DEFAULT
/PCOMPUTE &cat1 = EXPR(([1] + [59] + [2] + [58] + [47] + [3] + [4] + [54] + [55] + [56] + [57])) /PPROPERTIES &cat1 LABEL = "NET Central de Alimentos " FORMAT=COUNT F40.0, COLPCT.COUNT PCT40.1
HIDESOURCECATS=NO /PCOMPUTE &cat2 = EXPR(([9] + [10] + [11] + [12] + [13] + [14] + [15] + [45] + [16] + [17] + [21] + [18] + [20] + [19] + [43])) /PPROPERTIES &cat2 LABEL = "NET Kellogg's " FORMAT=COUNT F40.0, COLPCT.COUNT PCT40.1
HIDESOURCECATS=NO /TABLE p1 [C][COUNT '(f)' F40.0, COLPCT.COUNT '%V' PCT40.1, TOTALS[COUNT '(f)' F40.0, COLPCT.COUNT '%V' PCT40.1]] BY year [C] + Seis_Meses [C] + Dic2013_3Mes
[C] + Ene2014_3Mes [C] + Feb2014_3Mes [C] /CATEGORIES VARIABLES=p1 [ SUBTOTAL='Net Excellent Foods', 6, 7, 8, &cat1, SUBTOTAL='Net Gran Día', 1, 59, 2, 58, 47, 3, 4,
SUBTOTAL='Net Del Día', 54, 55, 56, 57, SUBTOTAL='Net Jack´s', 38, 37, 39, 40, 41, 42, &cat2, HSUBTOTAL='All Bran Kellogg´s', 9, HSUBTOTAL='Bran Flakes Kellogg´s', 10,
HSUBTOTAL='Choco Flakes Kellogg´s', 11, HSUBTOTAL='Choco Krispis Kellogg´s', 12, SUBTOTAL='Net Corn Flakes', 13, 14, HSUBTOTAL='Froot Loops Kellogg´s', 15,
SUBTOTAL='Net Komplete', 45, 16, 17, HSUBTOTAL='Raisin Bran Kellogg´s', 21, HSUBTOTAL='Rice Krispis Kellogg´s', 18, HSUBTOTAL='Special K de Kellogg´s', 20,
SUBTOTAL='Net Zucaritas', 19, 43, SUBTOTAL='Net Nestlé', 46, 22, 50, 23, 24, SUBTOTAL='Net Post', 25, 26, 27, SUBTOTAL='Net Quaker', 28, 29, 30, 31, 32, 33, 51, 44,
SUBTOTAL='Otros', 5, 34, 49, 48, 52, 35, 99, OTHERNM] EMPTY=EXCLUDE TOTAL=YES POSITION=BEFORE /CATEGORIES VARIABLES=year [2012, 2013, 2014] EMPTY=EXCLUDE TOTAL=YES POSITION=BEFORE /CATEGORIES VARIABLES=Seis_Meses ORDER=A KEY=VALUE EMPTY=INCLUDE
/CATEGORIES VARIABLES=Dic2013_3Mes [1, 2, 3] EMPTY=EXCLUDE /CATEGORIES VARIABLES=Ene2014_3Mes [1, 2, 3] EMPTY=EXCLUDE /CATEGORIES VARIABLES=Feb2014_3Mes [1, 2, 3] EMPTY=EXCLUDE /TITLES
TITLE='Top of Mind de Marcas' 'Pais: Guatemala' 'Cuadro: GT1' 'Preguntas: Q1' 'Base: Acumulado por pais' CORNER='CUADRO NO. 001' CAPTION='Proyecto: BPO' 'Categoría: Cereales Tostados'.
Si tuvieran alguna sugerencia, yo estare muy agradecido por su apoyo, mil gracias de antemano.
Va un ejemplo de la data: DATA LIST FREE /ncuest a1 TO a10. BEGIN DATA 1 2 3 4 50 35 8 9 15 17 22 2 22 23 15 1 4 8 . . . . 3 8 22 . . . . . . . .
4 9 22 23 . . . . . . . 5 15 16 . . . . . . . . 6 15 . . . . . . . . . 7 16 . . . . . . . . . 8 9 . . . . . . . . . 9 15 16 17 . . . . . . . 10 3 4 . . . . . . . .
END DATA. FORMATS ncuest (f4.0) a1 to a10 (f2.0). Ojo: no tengo que duplicar marcas o sea que no tengo que sumar los datos, si un entrevistado menciona 2 o mas presentaciones de una misma marca lo cuento como 1.
Atentamente, Javier Figueroa Procesamiento y Análisis de bases de datos |
Administrator
|
Perhaps you should cobble together a MUCH simplified example of the conceptual issue.
This is largely an English speaking group. Don't expect others to translate from Spanish (use Google Translate perhaps). I for one don't answer marketing research questions for free. Maybe you'll get lucky, but I somehow doubt it!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Thanks for responding David , I also ask my sincerest apologies for not writing in English but had already made a query in Spanish and had no answer , I thought this would also be well if , I would not think that this is some discrimination to people speaking inspana though so it seems , expect to have a little luck . Blessings and ferte hug. again thank you very much for responding. Hello experts SPSS I hope this Easter has been much reflection and restful sleep to begin operations in the mood , these days I have had to do work of dynamic tables with subtotals and totals by brand , but I have not been able to automatically generate , and would like to see if there are any suggestions to generate this table , my problem is this :
in my database I have a question that reads: That sancks known brands ? RM and I have this list of codes like this ( eg ) : 01 ' Bocadeli - No Expecificar ' 02 ' Bocadeli - Buenachos ' 03 ' Bocadeli - Dobrecitos Chizi Max , Cheese ' 04 ' Bocadeli - Frijoli ' 05 ' Bocadeli - Papasitas '
06 ' Bocadeli - Piguis ' 07 ' Bocadeli - Trix Quesi Spicy, With Cheese ' 08 ' Bocadeli - Toti Butter Pop ' 09 ' Bocadeli - Toti Cheese Pop ' 10 ' Bocadeli - Trumpets Pizza'
11 ' Diana - Without Expecificar ' 12 ' Diana - Churritos ' 13 ' Diana - Elotitos ' 14 ' Diana - Chinese Spicy Corn ' 15 ' Diana - Mani Japanese'
16 ' Diana - Lemon Mani ' 17 ' Diana - Mani Original' 18 ' Diana - Rabbit ' 19 ' Diana - Sticks ' 20 ' Diana - Quesitos ' 21 ' Diana - Tocinito '
22 ' Diana - Tortilla Chips Jalapeno ' 23 ' Diana - Tortilla Chips Nacho ' if you notice in the listing codes 08 and 09 are of the same brand but different presentation , the same goes with codes 15, 16 and 17 , also with 22 and 23.
then I have to generate a table showing me the total sub - codes 8 and 9 and a total of all make mother Bocadeli including codes 1 to 10 , all without duplicating information , since a respondent could mention several presentations of the same brand .
this is how as I have tried without success to generate . Beware: this table is for cat. cereal but it is the same case.
* Tablas personalizadas. CTABLES /FORMAT EMPTY=' -' MISSING='.'
/SMISSING VARIABLE /VLABELS VARIABLES=p1 year Seis_Meses Dic2013_3Mes Ene2014_3Mes Feb2014_3Mes DISPLAY=DEFAULT
/PCOMPUTE &cat1 = EXPR(([1] + [59] + [2] + [58] + [47] + [3] + [4] + [54] + [55] + [56] + [57])) /PPROPERTIES &cat1 LABEL = "NET Central de Alimentos " FORMAT=COUNT F40.0, COLPCT.COUNT PCT40.1
HIDESOURCECATS=NO /PCOMPUTE &cat2 = EXPR(([9] + [10] + [11] + [12] + [13] + [14] + [15] + [45] + [16] + [17] + [21] + [18] + [20] + [19] + [43]))
/PPROPERTIES &cat2 LABEL = "NET Kellogg's " FORMAT=COUNT F40.0, COLPCT.COUNT PCT40.1
HIDESOURCECATS=NO /TABLE p1 [C][COUNT '(f)' F40.0, COLPCT.COUNT '%V' PCT40.1, TOTALS[COUNT '(f)' F40.0,
COLPCT.COUNT '%V' PCT40.1]] BY year [C] + Seis_Meses [C] + Dic2013_3Mes [C] + Ene2014_3Mes [C] + Feb2014_3Mes [C]
/CATEGORIES VARIABLES=p1 [ SUBTOTAL='Net Excellent Foods', 6, 7, 8, &cat1, SUBTOTAL='Net Gran Día', 1, 59, 2, 58, 47, 3, 4,
SUBTOTAL='Net Del Día', 54, 55, 56, 57, SUBTOTAL='Net Jack´s', 38, 37, 39, 40, 41, 42, &cat2,
HSUBTOTAL='All Bran Kellogg´s', 9, HSUBTOTAL='Bran Flakes Kellogg´s', 10,
HSUBTOTAL='Choco Flakes Kellogg´s', 11, HSUBTOTAL='Choco Krispis Kellogg´s', 12,
SUBTOTAL='Net Corn Flakes', 13, 14, HSUBTOTAL='Froot Loops Kellogg´s', 15,
SUBTOTAL='Net Komplete', 45, 16, 17, HSUBTOTAL='Raisin Bran Kellogg´s', 21,
HSUBTOTAL='Rice Krispis Kellogg´s', 18, HSUBTOTAL='Special K de Kellogg´s', 20,
SUBTOTAL='Net Zucaritas', 19, 43, SUBTOTAL='Net Nestlé', 46, 22, 50, 23, 24,
SUBTOTAL='Net Post', 25, 26, 27, SUBTOTAL='Net Quaker', 28, 29, 30, 31, 32, 33, 51, 44,
SUBTOTAL='Otros', 5, 34, 49, 48, 52, 35, 99, OTHERNM] EMPTY=EXCLUDE TOTAL=YES POSITION=BEFORE
/CATEGORIES VARIABLES=year [2012, 2013, 2014] EMPTY=EXCLUDE TOTAL=YES POSITION=BEFORE /CATEGORIES VARIABLES=Seis_Meses ORDER=A KEY=VALUE EMPTY=INCLUDE
/CATEGORIES VARIABLES=Dic2013_3Mes [1, 2, 3] EMPTY=EXCLUDE /CATEGORIES VARIABLES=Ene2014_3Mes [1, 2, 3] EMPTY=EXCLUDE
/CATEGORIES VARIABLES=Feb2014_3Mes [1, 2, 3] EMPTY=EXCLUDE /TITLES
TITLE='Top of Mind de Marcas' 'Pais: Guatemala' 'Cuadro: GT1' 'Preguntas: Q1' 'Base: Acumulado por pais' CORNER='CUADRO NO. 001'
CAPTION='Proyecto: BPO' 'Categoría: Cereales Tostados'. If you have any suggestions, I will be very grateful for your support , thank you in advance . It 's an example of the data:
DATA LIST FREE /ncuest a1 TO a10. BEGIN DATA 1 2 3 4 50 35 8 9 15 17 22
2 22 23 15 1 4 8 . . . . 3 8 22 . . . . . . . . 4 9 22 23 . . . . . . .
5 15 16 . . . . . . . . 6 15 . . . . . . . . . 7 16 . . . . . . . . .
8 9 . . . . . . . . . 9 15 16 17 . . . . . . . 10 3 4 . . . . . . . .
END DATA. FORMATS ncuest (f4.0) a1 to a10 (f2.0). Note: I have not duplicating brands so do not I have to add the data, if a respondent mentioned 2 or more presentations of the same brand as the story 1. 2014-04-21 17:31 GMT-06:00 David Marso <[hidden email]>: Perhaps you should cobble together a MUCH simplified example of the Javier Figueroa Procesamiento y Análisis de bases de datos |
Administrator
|
It has nothing to do with discrimination based on language.
My best of luck refers to your expecting people to nap your complicated CTABLES code and your VAGUE description into anything useful. Take some time to CLEARLY explicate the issue with a SIMPLE table. Simple data and WHAT the table should look like. Again I am personally unlikely to help you with your TABLE but someone else might if you explain what you are trying to do with clarity. If you do post in Spanish you reduce your audience because few people will bother to run it through a Google Translate. Get it???
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by Javier Figueroa
Hola Javier;
se me ocurre que la solución "más limpia" a lo que quieres hacer es armar nuevas variables con los valores consolidados de las presentaciones / marcas y luego una múltiple que contenga todo. Voy con un ejemplo para que se entienda mejor. Asumo que las variables a1 to a10 son las distintas respuestas. Este proceso habría que repetirlo para cada agrupamiento. * Generamos la variable a1_89 que señala todos los casos donde se respondió 8 y/o 9. COUNT a1_89 = a1 to a10 (8 9). /* En la nueva variable contamos la cantidad de veces que aparecen las respuestas que nos interesan. RECODE a1_89 (1 THRU HI = 89) (ELSE=SYSMIS). /* se recodifica la variable y se le asigna un nuevo valor al consolidado. En este caso 89 (sea el caso que se mencionen las dos respuestas o una -sea cuál sea-). EXE. * Armamos la múltiple y generamos la tabla. MRSETS /MCGROUP VARIABLES = a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a1_89 NAME=$a LABEL='¿Que marcas de Sancks conoce? RM'. CTABLES /TABLE $a [c]. Espero que sea de utilidad. Saludos, Carlos El 21/04/2014 07:28 p.m., Javier Figueroa [via SPSSX Discussion] escribió:
|
Free forum by Nabble | Edit this page |