Computation of 95% confidence interval

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

Computation of 95% confidence interval

3J LEMA
My 10 variables are var1, var2, ...var10. I have N=500 in the file.  Appreciate if someone can provide SPSS syntax that will generate the mean and the 95% CI of the mean. The outputs should look like as follows:

Variables          Mean      95%LowerLimit      95%UpperLimit
Var1                 4.60         2.16                       4.90
Var2                 3.88         1.32                       4.00
Var3                 4.00         2.00                       4.89
.
.
.
Var10               3.99        3.00                         4.99

Thank you for your help.


Lema
===================== 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: Computation of 95% confidence interval

Bruce Weaver
Administrator
That looks like a job for CTABLES.  I rarely use that command, but I think
this example shows what you need to do.  Replace the *educ variables with
your var1 to var10.


NEW FILE.
DATASET CLOSE ALL.
* Change path as needed on next line.
GET FILE='C:\SPSSdata\survey_sample.sav'.


* Custom Tables.
CTABLES
  /VLABELS VARIABLES=educ paeduc maeduc speduc DISPLAY=NAME
  /TABLE
   educ   [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   paeduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   maeduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   speduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3]
  /CRITERIA CILEVEL=95.

Change DISPLAY=NAME to DISPLAY=LABEL if you have variable labels and want to
display them in the table.



3J LEMA wrote

> My 10 variables are var1, var2, ...var10. I have N=500 in the file.
> Appreciate if someone can provide SPSS syntax that will generate the mean
> and the 95% CI of the mean. The outputs should look like as follows:
>
> *Variables          Mean      95%LowerLimit      95%UpperLimit*
> *Var1                 4.60         2.16                       4.90*
> *Var2                 3.88         1.32                       4.00*
> *Var3                 4.00         2.00                       4.89*
> *.*
> *.*
> *.*
> *Var10               3.99        3.00                         4.99*
>
> Thank you for your help.
>
>
> Lema
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
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
--
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: Computation of 95% confidence interval

3J LEMA
Bruce, and All.

Thank you for the syntax.  Very helpful!
Stay safe and well.

Regards,
Lema

On Thu, 13 Aug 2020 at 20:25, Bruce Weaver <[hidden email]> wrote:
That looks like a job for CTABLES.  I rarely use that command, but I think
this example shows what you need to do.  Replace the *educ variables with
your var1 to var10.


NEW FILE.
DATASET CLOSE ALL.
* Change path as needed on next line.
GET FILE='C:\SPSSdata\survey_sample.sav'.


* Custom Tables.
CTABLES
  /VLABELS VARIABLES=educ paeduc maeduc speduc DISPLAY=NAME
  /TABLE
   educ   [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   paeduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   maeduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   speduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3]
  /CRITERIA CILEVEL=95.

Change DISPLAY=NAME to DISPLAY=LABEL if you have variable labels and want to
display them in the table.



3J LEMA wrote
> My 10 variables are var1, var2, ...var10. I have N=500 in the file.
> Appreciate if someone can provide SPSS syntax that will generate the mean
> and the 95% CI of the mean. The outputs should look like as follows:
>
> *Variables          Mean      95%LowerLimit      95%UpperLimit*
> *Var1                 4.60         2.16                       4.90*
> *Var2                 3.88         1.32                       4.00*
> *Var3                 4.00         2.00                       4.89*
> *.*
> *.*
> *.*
> *Var10               3.99        3.00                         4.99*
>
> Thank you for your help.
>
>
> Lema
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
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
===================== 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: Computation of 95% confidence interval

Jon Peck
Yes, that's good syntax, but the CTABLES canvas doesn't generate the best syntax.  This one could  be written more concisely as
CTABLES
  /VLABELS VARIABLES=educ paeduc maeduc speduc DISPLAY=NAME
  /TABLE (educ + paeduc + maeduc + speduc) [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3]
  /CRITERIA CILEVEL=95.

On Sun, Nov 1, 2020 at 10:24 PM 3J LEMA <[hidden email]> wrote:
Bruce, and All.

Thank you for the syntax.  Very helpful!
Stay safe and well.

Regards,
Lema

On Thu, 13 Aug 2020 at 20:25, Bruce Weaver <[hidden email]> wrote:
That looks like a job for CTABLES.  I rarely use that command, but I think
this example shows what you need to do.  Replace the *educ variables with
your var1 to var10.


NEW FILE.
DATASET CLOSE ALL.
* Change path as needed on next line.
GET FILE='C:\SPSSdata\survey_sample.sav'.


* Custom Tables.
CTABLES
  /VLABELS VARIABLES=educ paeduc maeduc speduc DISPLAY=NAME
  /TABLE
   educ   [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   paeduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   maeduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3] +
   speduc [S][MEAN F8.3, MEAN.LCL F8.3, MEAN.UCL F8.3]
  /CRITERIA CILEVEL=95.

Change DISPLAY=NAME to DISPLAY=LABEL if you have variable labels and want to
display them in the table.



3J LEMA wrote
> My 10 variables are var1, var2, ...var10. I have N=500 in the file.
> Appreciate if someone can provide SPSS syntax that will generate the mean
> and the 95% CI of the mean. The outputs should look like as follows:
>
> *Variables          Mean      95%LowerLimit      95%UpperLimit*
> *Var1                 4.60         2.16                       4.90*
> *Var2                 3.88         1.32                       4.00*
> *Var3                 4.00         2.00                       4.89*
> *.*
> *.*
> *.*
> *Var10               3.99        3.00                         4.99*
>
> Thank you for your help.
>
>
> Lema
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
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
===================== 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: Computation of 95% confidence interval

Bruce Weaver
Administrator
Thanks for the tip, Jon.  That's much more efficient.  


Jon Peck wrote
> Yes, that's good syntax, but the CTABLES canvas doesn't generate the best
> syntax.  This one could  be written more concisely as
> CTABLES
>   /VLABELS VARIABLES=educ paeduc maeduc speduc DISPLAY=NAME
>   /TABLE (educ + paeduc + maeduc + speduc) [S][MEAN F8.3, MEAN.LCL F8.3,
> MEAN.UCL F8.3]
>   /CRITERIA CILEVEL=95.





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
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
--
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/).