OneSample-Spss

Embed Size (px)

Citation preview

  • 7/28/2019 OneSample-Spss

    1/4

    Using SPSS for One Sample Tests

    SPSS isnt as good as Stata for one sample tests. As far as I know, it cant handle Case I at all.It does not have anything like Statas calculator functions, so you have to have raw data. Moreinformation is sometimes available in Statas output. Nonetheless, SPSS is probably adequate

    for most needs.

    A. Single Sample Tests Case I: Sampling distribution ofX , Normal parentpopulation (i.e. X is normally distributed), is known.

    I dont know of any way to do Case I in SPSS.

    B. Case II: Sampling distribution for the binomial parameter p.

    Problem. The mayor contends that 25% of the citys employees are black. Various left-wingand right-wing critics have claimed that the mayor is either exaggerating or understating thenumber of black employees. A random sample of 120 employees contains 18 blacks. Test themayors claim at the .01 level of significance.

    SPSS Solution. In SPSS, you use the NPAR TESTS command with the BINOMIAL option.(On the SPSS menus, it is Analyze/Nonparametric Tests/Binomial.) This gives you results that

    are identical (as far as I can tell) to Statas bi t est command. For the dichotomy, the default isfor the lower value to correspond to success while the higher value stands for failure (which is

    the opposite of the 0-1 failure/success coding used by bi t est ).

    * Ent er t he dat a. I am i ncl udi ng t he dat a i n t he synt ax, but i t i s pr obabl y* easi er j ust t o use t he SPSS Data edi t or .

    Data Li st Fr ee / X Wgt .Begi n Dat a.1 182 102End Dat a.Wei ght by Wgt .Val ue Label s X 1 "Success" 2 "Fai l ur e".

    NPAR TEST/ BI NOMI AL ( . 25) = X/ MI SSI NG ANALYSI S.

    Using SPSS for one sample tests Page 1

  • 7/28/2019 OneSample-Spss

    2/4

    NPar Tests

    Binomial Test

    Success 18 .15 .25 .005645a,b

    Failure 102 .85120 1.00

    Group 1

    Group 2Total

    XCategory N

    Observed

    Prop. Test Prop.

    Asymp. Sig.

    (1-tailed)

    Alternative hypothesis states that the proportion of cases in the first group = 18) = 0. 997208 ( one- si ded t est )Pr ( k

  • 7/28/2019 OneSample-Spss

    3/4

    T-Test

    One-Sample Statistics

    6 6.5000 1.41421 .57735payN Mean Std. Deviation

    Std. Error

    Mean

    One-Sample Test

    -2.598 5 .048 -1.50000 -2.6634 -.3366payt df Sig. (2-tailed)

    Mean

    Difference Lower Upper

    90% Confidence

    Interval of the

    Difference

    Test Value =8

    Compare this to Stata, where we got

    . t t est pay = 8, l evel ( 90)

    One- sampl e t t est

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Var i abl e | Obs Mean St d. Er r . St d. Dev. [ 90% Conf . I nt er val ]- - - - - - - - - +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    pay | 6 6. 5 . 5773503 1. 414214 5. 336611 7. 663389- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Degr ees of f r eedom: 5

    Ho: mean( pay) = 8

    Ha: mean < 8 Ha: mean ! = 8 Ha: mean > 8t = - 2. 5981 t = - 2. 5981 t = - 2. 5981

    P < t = 0. 0242 P > | t | = 0. 0484 P > t = 0. 9758

    The results are the same, except that SPSS reports the CI for the difference, i.e. it subtracts thehypothesized value from the upper and lower bounds. Hence, in SPSS, if 0 does not fall withinthe CI of the difference, you reject the null. For the 98% CI in SPSS,

    T- TEST/ TESTVAL = 8/ MI SSI NG = ANALYSI S/ VARI ABLES = pay/ CRI TERI A = CI ( . 98) .

    Using SPSS for one sample tests Page 3

  • 7/28/2019 OneSample-Spss

    4/4

    T-Test

    One-Sample Statistics

    6 6.5000 1.41421 .57735payN Mean Std. Deviation

    Std. Error

    Mean

    One-Sample Test

    -2.598 5 .048 -1.50000 -3.4427 .4427payt df Sig. (2-tailed)

    Mean

    Difference Lower Upper

    98% Confidence

    Interval of the

    Difference

    Test Value =8

    Again, this matches up with Statas results:

    . t t est pay = 8, l evel ( 98)

    One- sampl e t t est

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Var i abl e | Obs Mean St d. Er r . St d. Dev. [ 98% Conf . I nt er val ]- - - - - - - - - +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    pay | 6 6. 5 . 5773503 1. 414214 4. 557257 8. 442743- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Degr ees of f r eedom: 5

    Ho: mean( pay) = 8

    Ha: mean < 8 Ha: mean ! = 8 Ha: mean > 8

    t = - 2. 5981 t = - 2. 5981 t = - 2. 5981P < t = 0. 0242 P > | t | = 0. 0484 P > t = 0. 9758

    Using SPSS for one sample tests Page 4