Average Daily Population

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

Average Daily Population

Christopher Lowenkamp
I have a rather large (750,000 records) dataset of jai data covering the
past 15 years.  Each record represents a person booked into the jail and
includes the intake and release dates and times.

I am trying to determine a method to calculate average daily counts--that
is on any given day how many people are in the jail.

Any suggestions?

Thanks
Chris

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Average Daily Population

Bill Oglesby
Chris,

I'm not entirely sure what sort of assistance you're asking for, whether a way of conceptualizing
average daily headcount or the means of using SPSS to accomplish this. If the former, I might break
out the data by year (say, fiscal year), first, then by c.o. shifts, perhaps, in order to further divide the
day. With respect to the latter, I think I might select the sub-populations of interest (by year or by
year and shift) using the SPSS interface and then run a simple frequency to determine averages.
There may be a far less cumbersome way of doing this using syntax, but my knowledge of syntax is
fairly limited. Any other ideas, folks?

Bill

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Average Daily Population

Maguin, Eugene
In reply to this post by Christopher Lowenkamp
Christopher,

A question very much like yours came up within the past 3-4 months, I think,
and Richard Ristow posted very nice solution. You might search the archives
with relevant terms.

Gene Maguin

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Average Daily Population

Peck, Jon
In reply to this post by Christopher Lowenkamp
Here is a simple Python solution.  It produces a sav file with a value for every day between specified start and end dates.  Then you can do whatever you like with that.

I can email this off list if you want to use it, since the listserve tends to mangle indentation.
Of course, this requires the Python plug-in, but it will work with SPSS 15 or later.  Prior to 16, you would need to download the spssaux, spssdata, and namedTuple modules from SPSS Developer Central.

It assumes that there is some initial population, defaulting to 0, and that there could be incomplete records, i.e., only an admit or a discharge date.

The example below covers 1/1/1990 - 12/31/2008.

HTH,
Jon Peck

# Create a dataset where cases are dates (days) and variable inmatecount
# shows the current population

import spss, spssaux, spssdata
from spssdata import vdef
spssaux.OpenDataFile("c:/temp/jail.sav")

def datetab(startdate, enddate, initial=0):
    """start date is the SPSS date value to start checking, e.g., Jqn 1, 1990 = 12850531200
    and  Dec 31, 2008 = 13450060800.
    end date is the date to stop checking.
    initial is the initial jail population, defaulting to 0.

    It is assumed that the admit date variable is named indate and the discharge is outdate.

    Each date on which is convered by any inmate transaction will appear"""
    curs = spssdata.Spssdata()
    datecounts = {}
    for case in curs:
        for d in range(startdate, enddate, 86400):
            if case.indate is None:
                case.indate = 0
            if case.outdate is None:
                case.outdate = 1e20
            if case.indate <= d <= case.outdate:
                datecounts[d] = datecounts.get(d, initial) + 1
    curs.CClose()

    curs = spssdata.Spssdata(accessType="n")
    curs.append(vdef("tallydate", vfmt=("DATE", 20)))
    curs.append("inmatecount")
    curs.commitdict()
    for date, count in datecounts.items():
        curs.appendvalue("tallydate", date)
        curs.appendvalue("inmatecount", count)
        curs.CommitCase()
    curs.CClose()
    spss.Submit("SORT CASES BY tallydate")

datetab(startdate=12850531200, enddate=13450060800)
spssaux.saveDataFile("c:/temp/datestats.sav")

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Christopher Lowenkamp
Sent: Monday, October 13, 2008 12:07 PM
To: [hidden email]
Subject: [SPSSX-L] Average Daily Population

I have a rather large (750,000 records) dataset of jai data covering the
past 15 years.  Each record represents a person booked into the jail and
includes the intake and release dates and times.

I am trying to determine a method to calculate average daily counts--that
is on any given day how many people are in the jail.

Any suggestions?

Thanks
Chris

=====================
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

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Average Daily Population

David Greenberg
In reply to this post by Christopher Lowenkamp
Without some additional information, you can't do this. Imagine two different situations. In the first, at the first year of your data set, all jails were opening for the first time, with no inmates. In the second situation, there is an already existing large population in the jails serving life sentences. Probably neither situation describes your data set, but these examples will make the point. At the end of fifteen years, with the same pattern of admissions and releases, you will have very different current populations. David Greenberg, Sociology Department, New York University

----- Original Message -----
From: Christopher Lowenkamp <[hidden email]>
Date: Monday, October 13, 2008 2:29 pm
Subject: Average Daily Population
To: [hidden email]


> I have a rather large (750,000 records) dataset of jai data covering the
> past 15 years.  Each record represents a person booked into the jail and
> includes the intake and release dates and times.
>
> I am trying to determine a method to calculate average daily counts--that
> is on any given day how many people are in the jail.
>
> Any suggestions?
>
> Thanks
> Chris
>
> =====================
> 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

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Average Daily Population

Richard Ristow
In reply to this post by Maguin, Eugene
At 03:46 PM 10/13/2008, Gene Maguin wrote:

>A question very much like yours came up within the past 3-4 months, I think,
>and Richard Ristow posted very nice solution.

Thanks. Posting, with full tested code and listing, is
Date:     Wed, 23 Jul 2008 20:23:17 -0400
From:     Richard Ristow <[hidden email]>
Subject:  Re: daily number of patients
To:       [hidden email]

=====================
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
Reply | Threaded
Open this post in threaded view
|

Multiple Imputation

Mccoach, D. Betsy
In reply to this post by Bill Oglesby
Am I correct that there is no way to do analyze multiple imputed data
sets in SPSS?
If I am wrong, can anyone point me toward information/documentation on
using multiply imputed datasets in SPSS?
Thanks in advance,

Betsy

D. Betsy McCoach, Ph.D.
Associate Professor
Measurement, Evaluation, and Assessment Program
Educational Psychology Department
University of Connecticut
249 Glenbrook Road, Unit 2064
Storrs, CT 06269-2064
Phone: 860-486-0183
Fax: 860-486-0180
Email: [hidden email]

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Imputation

Weeks, Kyle
Betsy,

Multiple imputation is part of version 17.  Please see http://www.spss.com/PDFs/SMV17SPClr.pdf for more information on multiple imputation.

Regards.

Kyle Weeks, Ph.D.
Director of Product Strategy, SPSS Statistics
SPSS Inc.
[hidden email]
www.spss.com
SPSS Inc. helps organizations turn data into insight through predictive analytics.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mccoach, D. Betsy
Sent: Tuesday, October 14, 2008 2:46 PM
To: [hidden email]
Subject: Multiple Imputation

Am I correct that there is no way to do analyze multiple imputed data
sets in SPSS?
If I am wrong, can anyone point me toward information/documentation on
using multiply imputed datasets in SPSS?
Thanks in advance,

Betsy

D. Betsy McCoach, Ph.D.
Associate Professor
Measurement, Evaluation, and Assessment Program
Educational Psychology Department
University of Connecticut
249 Glenbrook Road, Unit 2064
Storrs, CT 06269-2064
Phone: 860-486-0183
Fax: 860-486-0180
Email: [hidden email]

=====================
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

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Imputation

Maguin, Eugene
In reply to this post by Mccoach, D. Betsy
Betsy,

Not directly.
But, you could add a new variable to each dataset, call it 'replication',
with values of 1 thru n imputed datasets and then 'stack' the datasets via
an add files command. Then split the file by replication and run your
procedures. Use OMS to output the parameter tables and use Rubin's formulas
to combine them. Not as nice as Mplus or sas but you can do it.

Gene Maguin

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Imputation

Kooij, A.J. van der
In reply to this post by Mccoach, D. Betsy
 
SPSS macros for multiple imputation in test- and questionnaire data can
be downloaded from http://www.datatheory.nl/pages/ginkel.html or
http://www.uvt.nl/mto/software2.html. Macros for combining the results
of statistical analyses of the multiply imputed datasets can also be
downloaded from these links. The methods are described in
 
Van Ginkel, J. R., Van der Ark, L. A., & Sijtsma, K. (2007). Multiple
imputation of test and questionnaire data and influence on psychometric
results. Multivariate Behavioral Research, 42, 387-414
 
and
 
Van Ginkel, J. R., Van der Ark, L. A., & Sijtsma, K. (2007). Multiple
imputation for item scores when test data are factorially complex.
British Journal of Mathematical and Statistical Psychology, 60, 315-337.
 
Best Regards,
Joost van Ginkel

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

 

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Mccoach, D. Betsy
Sent: Tuesday, October 14, 2008 2:46 PM
To: [hidden email]
Subject: Multiple Imputation

Am I correct that there is no way to do analyze multiple imputed data
sets in SPSS?
If I am wrong, can anyone point me toward information/documentation on
using multiply imputed datasets in SPSS?
Thanks in advance,

Betsy

D. Betsy McCoach, Ph.D.
Associate Professor
Measurement, Evaluation, and Assessment Program
Educational Psychology Department
University of Connecticut
249 Glenbrook Road, Unit 2064
Storrs, CT 06269-2064
Phone: 860-486-0183
Fax: 860-486-0180
Email: [hidden email]

=====================
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

=====================
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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



====================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
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Imputation

Fry, Jonathan B.
In reply to this post by Mccoach, D. Betsy
Multiple imputation (both generation and analysis) is offered as an optional feature with the current release.

Jonathan Fry
SPSS Inc.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mccoach, D. Betsy
Sent: Tuesday, October 14, 2008 2:46 PM
To: [hidden email]
Subject: Multiple Imputation

Am I correct that there is no way to do analyze multiple imputed data
sets in SPSS?
If I am wrong, can anyone point me toward information/documentation on
using multiply imputed datasets in SPSS?
Thanks in advance,

Betsy

D. Betsy McCoach, Ph.D.
Associate Professor
Measurement, Evaluation, and Assessment Program
Educational Psychology Department
University of Connecticut
249 Glenbrook Road, Unit 2064
Storrs, CT 06269-2064
Phone: 860-486-0183
Fax: 860-486-0180
Email: [hidden email]

=====================
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

=====================
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