spliting variable

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

spliting variable

Caleb Ouma
Dear Listers,
I have a variable named household numer which has a combination of several numbers. The first two digits is the cluster number.
I need to have the cluster number as a separate variable
eg
120081079/00/0 to 12
110081071/00/1 to 11
 
Any help?
 

 

 

Caleb Ouma

Dataworld Research

P.O Box 1984-00200

NAIROBI


Alt. E-mail: [hidden email]

                  [hidden email]

Skype: caleb.ouma




Reply | Threaded
Open this post in threaded view
|

Calculating polychoric correlations?

Mbaye Fall Diallo
Dear all,
Does someone know a program that can calculate polychoric correlations? I have normality problem with some of my variables and I was told that using polychoric correlations may be a solution. I'm using Amos and it doesn't calculate polychoric correlations. I don't have access to Lisrel or Mplus.

Any help will be appreciated.

Mbaye,

Commander un cadeau en ligne discrètement? Voir la solution offerte par Internet Explorer8
Reply | Threaded
Open this post in threaded view
|

Re: spliting variable

John F Hall
In reply to this post by Caleb Ouma
You really need to supply more information about your data file.
 
If the first part of your variable is numeric (ie not the slashes. 00 etc.), try
 
compute newnum = trunc (oldnum / 1000000) .
 
If it's a string with the slashes included, someone else will have a solution.
 
If your raw data are in fixed format, and the housenum is at the beginning of the first data line, you could read in the data as
 
data list file = <file address>
    records = <number of records>
    /1 housnum  1-2 .
 
If your data are on a different file format, you should be able to output a *.txt file as a preliminary step.
----- Original Message -----
Sent: Thursday, May 06, 2010 10:51 AM
Subject: spliting variable

Dear Listers,
I have a variable named household numer which has a combination of several numbers. The first two digits is the cluster number.
I need to have the cluster number as a separate variable
eg
120081079/00/0 to 12
110081071/00/1 to 11
 
Any help?
 

 

 

Caleb Ouma

Dataworld Research

P.O Box 1984-00200

NAIROBI


Alt. E-mail: [hidden email]

                  [hidden email]

Skype: caleb.ouma




Reply | Threaded
Open this post in threaded view
|

Re: Calculating polychoric correlations?

Bruce Weaver
Administrator
In reply to this post by Mbaye Fall Diallo
Mbaye Fall Diallo wrote
Dear all,

Does someone know a program that can calculate polychoric correlations? I
 have normality problem with some of my variables and I was told that
using polychoric correlations may be a solution. I'm using Amos and it
doesn't calculate polychoric correlations. I don't have access to Lisrel
 or Mplus.



Any help will be appreciated.

Mbaye,                                          
I've not used it, so cannot vouch for it, but here's one:

   http://www.john-uebersax.com/stat/xpc.htm

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Calculating polychoric correlations?

Jon K Peck
In reply to this post by Mbaye Fall Diallo

The HETCOR extension command available with Statistics V17 or later does this (polyserial, polychoric, and Pearson).  It can be downloaded from SPSS Developer Central (www.spss.com/devcentral).  Requirements are in the readme file in the download.

HTH,
Jon Peck
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Mbaye Fall Diallo <[hidden email]>
To: [hidden email]
Date: 05/06/2010 03:28 AM
Subject: [SPSSX-L] Calculating polychoric correlations?
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Dear all,
Does someone know a program that can calculate polychoric correlations? I have normality problem with some of my variables and I was told that using polychoric correlations may be a solution. I'm using Amos and it doesn't calculate polychoric correlations. I don't have access to Lisrel or Mplus.

Any help will be appreciated.

Mbaye,

Commander un cadeau en ligne discrètement? Voir la solution offerte par Internet Explorer8

Reply | Threaded
Open this post in threaded view
|

Re: Calculating polychoric correlations?

Mark A Davenport MADAVENP
In reply to this post by Mbaye Fall Diallo

Mbaye,

You will find the Polycor plug-in here.  I recall that it is pretty easy to install but you first have to install R.

http://www.spss.com/devcentral/index.cfm?pg=downloadDet&dId=191

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)





Mbaye Fall Diallo <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>

05/06/2010 05:31 AM

Please respond to
Mbaye Fall Diallo <[hidden email]>

To
[hidden email]
cc
Subject
Calculating polychoric correlations?





Dear all,
Does someone know a program that can calculate polychoric correlations? I have normality problem with some of my variables and I was told that using polychoric correlations may be a solution. I'm using Amos and it doesn't calculate polychoric correlations. I don't have access to Lisrel or Mplus.

Any help will be appreciated.

Mbaye,

Commander un cadeau en ligne discrètement? Voir la solution offerte par Internet Explorer8
Reply | Threaded
Open this post in threaded view
|

Re: Calculating polychoric correlations?

Mark A Davenport MADAVENP
In reply to this post by Jon K Peck

Jon,

I thought Polycor superceeded HETCOR.  Which do you recommend?  Do they work with v18?

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)


Reply | Threaded
Open this post in threaded view
|

Re: Calculating polychoric correlations?

ANDRES ALBERTO BURGA LEON
In reply to this post by Mbaye Fall Diallo

The program FACTOR con do it:

http://psico.fcep.urv.cat/utilitats/factor/

Andrés

Mg. Andrés Burga León
Coordinador de Análisis e Informática
Unidad de Medición de la Calidad Educativa
Ministerio de Educación del Perú
Calle El Comercio s/n (espalda del Museo de la Nación)
Lima 41
Perú
Teléfono 615-5840



Mbaye Fall Diallo <[hidden email]>
Enviado por: "SPSSX(r) Discussion" <[hidden email]>

06/05/2010 04:44 a.m.

Por favor, responda a
Mbaye Fall Diallo <[hidden email]>

Para
[hidden email]
cc
Asunto
Calculating polychoric correlations?





Dear all,
Does someone know a program that can calculate polychoric correlations? I have normality problem with some of my variables and I was told that using polychoric correlations may be a solution. I'm using Amos and it doesn't calculate polychoric correlations. I don't have access to Lisrel or Mplus.

Any help will be appreciated.

Mbaye,

Commander un cadeau en ligne discrètement? Voir la solution offerte par Internet Explorer8
Reply | Threaded
Open this post in threaded view
|

Creating new data with sample mean

ANDRES ALBERTO BURGA LEON
In reply to this post by Mbaye Fall Diallo

Hello to everybody:

I need to create a new dataset containning the means from X random samples taken from a dataset called "normal".


Firt, I've made this macro to create a normal distribution of test scores:

DEFINE !normal(casos=!TOKENS(1) / media=!TOKENS(1) / de=!TOKENS(1))
INPUT PROGRAM.
+ LOOP caso = 1 TO !casos.
+   COMPUTE medida = RND(RV.NORMAL(!media,!de)) .
+   END CASE.
+ END LOOP.
+ END FILE.
END INPUT PROGRAM.
FORMATS caso (F10.0).
FORMATS medida (F3.0).
EXECUTE .
DATASET NAME normal.
!ENDDEFINE.

!normal casos=5000 media=23 de=7.

Then I draw a random sample of 500 cases (dataset "data")  and create a new dataset containing the sample mean ("media"):

DATASET ACTIVATE normal.
DATASET COPY  data.
DATASET ACTIVATE  data.
FILTER OFF.
USE ALL.
SAMPLE  500 from 5000.
EXECUTE.

DATASET DECLARE media.
AGGREGATE
  /OUTFILE='media'
  /BREAK=
  /medida_media=MEAN(medida)
  /casos=N.
DATASET CLOSE data.


Finaly I need to repeat the following syntax 200 times to have 200 diferent means estimates agregated to the "media" dataset, but I'm not sure how to do it:

DATASET ACTIVATE normal.
DATASET COPY  data.
DATASET ACTIVATE  data.
FILTER OFF.
USE ALL.
SAMPLE  500 from 5000.
EXECUTE.

DATASET DECLARE temporal.
AGGREGATE
  /OUTFILE='temporal'
  /BREAK=
  /medida_media=MEAN(medida)
  /casos=N.

DATASET ACTIVATE media.
ADD FILES /FILE=*
  /FILE='temporal'.
EXECUTE.
DATASET CLOSE temporal.
DATASET CLOSE data.

Coul somebody help me tho specify the sintax for repeating the last part 200 times

Thank you

Andrés



Mg. Andrés Burga León
Coordinador de Análisis e Informática
Unidad de Medición de la Calidad Educativa
Ministerio de Educación del Perú
Calle El Comercio s/n (espalda del Museo de la Nación)
Lima 41
Perú
Teléfono 615-5840
Reply | Threaded
Open this post in threaded view
|

Re: Creating new data with sample mean

Art Kendall
below is some syntax I created some years ago to demo distribution of sample means.
you can adapt the compute statement to match your needs.

*draw 1000 samples of size 50 without replacement.
*create some data.
new file.
set seed = 20051209.
INPUT PROGRAM.
loop set = 1 to 1000.
leave set.
LOOP id=1 TO 50.
COMPUTE x = rv.normal(0,1).
END CASE.
END LOOP.
end loop.
END FILE.
END INPUT PROGRAM.
dataset declare rawfile.
FORMATS set id (F4.0) x (f6.3).
descriptives variables =x/statistics=all.
dataset declare aggfile.
aggregate outfile=aggfile
  /break = set
  /setmean = mean(x).
dataset activate aggfile.
descriptives variables= setmean /statistics=all.



Art Kendall
Social Research Consultants

On 5/6/2010 12:58 PM, ANDRES ALBERTO BURGA LEON wrote:

Hello to everybody:

I need to create a new dataset containning the means from X random samples taken from a dataset called "normal".


Firt, I've made this macro to create a normal distribution of test scores:

DEFINE !normal(casos=!TOKENS(1) / media=!TOKENS(1) / de=!TOKENS(1))
INPUT PROGRAM.
+ LOOP caso = 1 TO !casos.
+   COMPUTE medida = RND(RV.NORMAL(!media,!de)) .
+   END CASE.
+ END LOOP.
+ END FILE.
END INPUT PROGRAM.
FORMATS caso (F10.0).
FORMATS medida (F3.0).
EXECUTE .
DATASET NAME normal.
!ENDDEFINE.

!normal casos=5000 media=23 de=7.

Then I draw a random sample of 500 cases (dataset "data")  and create a new dataset containing the sample mean ("media"):

DATASET ACTIVATE normal.
DATASET COPY  data.
DATASET ACTIVATE  data.
FILTER OFF.
USE ALL.
SAMPLE  500 from 5000.
EXECUTE.

DATASET DECLARE media.
AGGREGATE
  /OUTFILE='media'
  /BREAK=
  /medida_media=MEAN(medida)
  /casos=N.
DATASET CLOSE data.


Finaly I need to repeat the following syntax 200 times to have 200 diferent means estimates agregated to the "media" dataset, but I'm not sure how to do it:

DATASET ACTIVATE normal.
DATASET COPY  data.
DATASET ACTIVATE  data.
FILTER OFF.
USE ALL.
SAMPLE  500 from 5000.
EXECUTE.

DATASET DECLARE temporal.
AGGREGATE
  /OUTFILE='temporal'
  /BREAK=
  /medida_media=MEAN(medida)
  /casos=N.

DATASET ACTIVATE media.
ADD FILES /FILE=*
  /FILE='temporal'.
EXECUTE.
DATASET CLOSE temporal.
DATASET CLOSE data.

Coul somebody help me tho specify the sintax for repeating the last part 200 times

Thank you

Andrés



Mg. Andrés Burga León
Coordinador de Análisis e Informática
Unidad de Medición de la Calidad Educativa
Ministerio de Educación del Perú
Calle El Comercio s/n (espalda del Museo de la Nación)
Lima 41
Perú
Teléfono 615-5840
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Calculating polychoric correlations?

Mbaye Fall Diallo
In reply to this post by ANDRES ALBERTO BURGA LEON
Many thanks for all your suggestions. I will try and let you know.

Best,

Mbaye,


Date: Thu, 6 May 2010 11:48:29 -0500
From: [hidden email]
Subject: Re: Calculating polychoric correlations?
To: [hidden email]


The program FACTOR con do it:

http://psico.fcep.urv.cat/utilitats/factor/

Andrés

Mg. Andrés Burga León
Coordinador de Análisis e Informática
Unidad de Medición de la Calidad Educativa
Ministerio de Educación del Perú
Calle El Comercio s/n (espalda del Museo de la Nación)
Lima 41
Perú
Teléfono 615-5840



Mbaye Fall Diallo <[hidden email]>
Enviado por: "SPSSX(r) Discussion" <[hidden email]> 06/05/2010 04:44 a.m.
Por favor, responda a
Mbaye Fall Diallo <[hidden email]>


Para
[hidden email]
cc
Asunto
Calculating polychoric correlations?





Dear all,
Does someone know a program that can calculate polychoric correlations? I have normality problem with some of my variables and I was told that using polychoric correlations may be a solution. I'm using Amos and it doesn't calculate polychoric correlations. I don't have access to Lisrel or Mplus.

Any help will be appreciated.

Mbaye,

Commander un cadeau en ligne discrètement? Voir la solution offerte par Internet Explorer8


Télécharger en toute sécurité sur Internet ? La solution avec Internet Explorer 8
Reply | Threaded
Open this post in threaded view
|

Re: spliting variable

Albert-Jan Roskam
In reply to this post by John F Hall
Hi,

Do you mean simply the substring of household number?

* sample data.
data list free / hhno (a40).
begin data
120081079/00/0
110081071/00/1
end data.

*code.
compute clusterno = number(substr(hhno, 1, 2), f2.0).

Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Thu, 5/6/10, John F Hall <[hidden email]> wrote:

From: John F Hall <[hidden email]>
Subject: Re: [SPSSX-L] spliting variable
To: [hidden email]
Date: Thursday, May 6, 2010, 12:17 PM

You really need to supply more information about your data file.
 
If the first part of your variable is numeric (ie not the slashes. 00 etc.), try
 
compute newnum = trunc (oldnum / 1000000) .
 
If it's a string with the slashes included, someone else will have a solution.
 
If your raw data are in fixed format, and the housenum is at the beginning of the first data line, you could read in the data as
 
data list file = <file address>
    records = <number of records>
    /1 housnum  1-2 .
 
If your data are on a different file format, you should be able to output a *.txt file as a preliminary step.
----- Original Message -----
From: Caleb Ouma
Sent: Thursday, May 06, 2010 10:51 AM
Subject: spliting variable

Dear Listers,
I have a variable named household numer which has a combination of several numbers. The first two digits is the cluster number.
I need to have the cluster number as a separate variable
eg
120081079/00/0 to 12
110081071/00/1 to 11
 
Any help?
 

 

 

Caleb Ouma

Dataworld Research

P.O Box 1984-00200

NAIROBI


Alt. E-mail: caleb@...

                  [hidden email]

Skype: caleb.ouma