SPSS Boot Strapping Module

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

SPSS Boot Strapping Module

SUBSCRIBE SPSSX-JohnF
I am not doing the work and don't use the module, but this question came up amongst colleagues, if you run 100 samples, is there a way to
obtain output results presenting the mean and std dev of each sample?

Thanks.....

=====================
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: SPSS Boot Strapping Module

Jon Peck
This question has come up before.  I wonder why users want this.  It is not currently possible AFAIK

On Mon, Dec 21, 2020 at 9:33 AM SUBSCRIBE SPSSX-JohnF <[hidden email]> wrote:
I am not doing the work and don't use the module, but this question came up amongst colleagues, if you run 100 samples, is there a way to
obtain output results presenting the mean and std dev of each sample?

Thanks.....

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


--
Jon K Peck
[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: SPSS Boot Strapping Module

Art Kendall
In reply to this post by SUBSCRIBE SPSSX-JohnF
Below is some syntax to demonstrate the concept of sampling with replacement.
You can adapt it by removing the section that generates the "pop" and using
the rest as an example.

The example draws samples of size 50, you could adapt it to draw samples of
size N-1

Bootstrap
Select samples of a given size with replacement from a data set (as a
stand-in for a pop) x times,
Keep summary statistics  for each of the x samples,
Do many explorations of the summary statistics.

* this syntax shows one approach to sampling WITH replacement.
* it does so by generating a random number which is used as
* an index into the vector of pop values.
* it has been tweaked based on a discussion on SPSSX-l.
* see the archives for a discussion entitled
* " Random sampling & matrix of histograms problem".
* Jon Peck mentioned that those who have the complex sampling module can use
that
* to draw samples with replacement.
* David Marso uses MATRIX.
* Andy W has an approach with more compact syntax that works with original
in long format.
* to use it you need to put your data in wide format and set the vector to
the pop size.
*
new file.
set seed 20130407.
input program.
   vector PopX(1000,f6.3).
   loop #i = 1 to 1000.
      compute PopX(#i) = rv.normal(0,1).
   end loop.
   end case.
   end file.
end input program.
execute.
dataset name madeup.
dataset activate madeup.

* this next command needs to be adapted to your data.
vector PopX = PopX1 to PopX1000.

* from pop of 1000 draw 100 samples of size 50 WITH replacement.
compute #PopSize = 1000.
compute #nSamples=100.
compute #nDraws=50.
numeric SampledX (f6.3) CasePicked (N7).
loop sample_id = 1 to #nSamples.
   loop draw = 1 to #nDraws.
      compute CasePicked = trunc(rv.uniform(1, (#PopSize+1))).
      compute SampledX = PopX(CasePicked).
      xsave outfile = 'c:\project\long1.sav' /keep =sample_id draw
CasePicked SampledX.
   end loop.
end loop.
execute.
get file= 'c:\project\long1.sav'.
dataset name longy.
split file by sample_id.
frequencies vars = casepicked /format=dfreq.
descriptives variables = SampledX.





-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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: SPSS Boot Strapping Module

David Marso-2
In reply to this post by SUBSCRIBE SPSSX-JohnF
I posted such years ago. Search the archives

=====================
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: SPSS Boot Strapping Module

Marta Garcia-Granero
In reply to this post by Jon Peck

Hi:


Getting the bootstrapped means can be useful, as discussed in: https://journals.physiology.org/doi/pdf/10.1152/advan.00064.2017


In a nutshell: the assumption of normality is tested on the distribution of bootstrapped means, instead of in the original data, using q-q plots.


From the paper: "The most versatile approach to assess normality is to bootstrap the sample mean, the difference between sample means, or t itself. We can then assess whether the distributions of these bootstrap statistics are consistent with a normal distribution by studying their normal quantile plots"


I really like, and use, that feature of Stata (being able to save the bootstrapped statistics to an external file for later use)


Merry Christmas

Marta

This question has come up before.  I wonder why users want this.  It is not currently possible AFAIK

On Mon, Dec 21, 2020 at 9:33 AM SUBSCRIBE SPSSX-JohnF <[hidden email]> wrote:
I am not doing the work and don't use the module, but this question came up amongst colleagues, if you run 100 samples, is there a way to
obtain output results presenting the mean and std dev of each sample?

Thanks.....

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


--
Jon K Peck
[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: SPSS Boot Strapping Module

Jon Peck
Thanks, Marta,

Some years ago, John Bauer created a Python module for SPSS Statistics that can bootstrap an arbitrary procedure.  I have updated it to Python 3 and posted it on my OneDrive here
(It used to be on the old SPSS Community site, but that site is gone.)

It is a zip file with two items: the Python module and an example SPSS syntax file that shows the usage.  While using the module requires a little bit of Python knowledge, it isn't much.  All you have to change is the syntax to run, the OMS name of the table to bootstrap, and the number of replicates.  The output includes several datasets, including the statistics for each of the replicates.  The example uses REGRESSION.

To install this, just extract the .py file to a location where Python can find it such as the Python3\lib\site-packages directory under your Statistics installation,

The bootstrap module includes a number of sampling methods that might be useful independently of bootstrapping.




On Tue, Dec 22, 2020 at 7:49 AM Marta Garcia-Granero <[hidden email]> wrote:

Hi:


Getting the bootstrapped means can be useful, as discussed in: https://journals.physiology.org/doi/pdf/10.1152/advan.00064.2017


In a nutshell: the assumption of normality is tested on the distribution of bootstrapped means, instead of in the original data, using q-q plots.


From the paper: "The most versatile approach to assess normality is to bootstrap the sample mean, the difference between sample means, or t itself. We can then assess whether the distributions of these bootstrap statistics are consistent with a normal distribution by studying their normal quantile plots"


I really like, and use, that feature of Stata (being able to save the bootstrapped statistics to an external file for later use)


Merry Christmas

Marta

This question has come up before.  I wonder why users want this.  It is not currently possible AFAIK

On Mon, Dec 21, 2020 at 9:33 AM SUBSCRIBE SPSSX-JohnF <[hidden email]> wrote:
I am not doing the work and don't use the module, but this question came up amongst colleagues, if you run 100 samples, is there a way to
obtain output results presenting the mean and std dev of each sample?

Thanks.....

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


--
Jon K Peck
[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


--
Jon K Peck
[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