Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Calculating variance / std deviation

  • 04-12-2013 12:06AM
    #1
    Registered Users, Registered Users 2, Paid Member Posts: 3,784 ✭✭✭


    Hi

    Working on this question:

    In a sample of 200 registered voters, 108 plan to vote for candidate A. Construct a 95% confidence interval for the proportion of voters that plan to vote for Candidate A.

    Two questions on this:
    1) Do I use (p)(q) = (108/200)(92/200) to calculate variance & std dev? Or should I use (n)(p)(q)??
    2) Is this result considered "S" or "Sigma" squared? i.e. do I subsequently calculate the Z-statistic or the t-statistic?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 5,130 ✭✭✭Yakuza


    http://en.wikipedia.org/wiki/Binomial_distribution#Normal_approximation

    B(n,p)~ N(np,npq) (Variance is npq), standard dev is [latex]\sqrt{npq}[/latex]

    Your interval is 1.96 standard devs either side of the mean.


  • Registered Users, Registered Users 2, Paid Member Posts: 3,784 ✭✭✭MacDanger


    Good stuff, thanks Yakuza


  • Registered Users, Registered Users 2, Paid Member Posts: 3,784 ✭✭✭MacDanger


    Hi

    Are you sure about that? When I calculate it out, the result doesn't make any sense. Or am I making a mistake somewhere??

    95% CI for the proportion of voters voting for candidate A:

    Z97.5 = 1.96; n = 200; p = 0.54; q = 0.46
    μ = p = 0.54;
    σ2 = (n)(p)(q) = (200)(0.54)(0.46) = 49.68; σ = 7.048

    CI = μ ± (Z97.5)(σ/√n)
    = 0.54 ± (1.96)(7.048√200) = 0.54 ± 0.977 = [-0.437, 1.517]

    A negative value and a value > 1 for proportion of voters makes no sense?

    Calculating using σ2 = (p)(q) = (0.54)(0.46) = 0.2484; σ = 0.4984
    Gives:
    CI = μ ± (Z97.5)(σ/√n)
    = 0.54 ± (1.96)(0.4984/√200) = 0.54 ± 0.069 = [0.471, 0.609]

    Which appears to be a reasonable CI although perhaps tighter than I would have expected.

    Any help appreciated :-)


  • Registered Users, Registered Users 2 Posts: 5,130 ✭✭✭Yakuza


    μ isn't 0.54, it's np, or 108.
    I'd have given 108 ± 1.96 * 7.048 as the CI for the number of voters, or roughly [94.185,121.815].
    The question actually asks for the proportion so you need to divide the above by 200, yielding [0.471,0.609].

    We both got there in the end :)


  • Registered Users, Registered Users 2, Paid Member Posts: 3,784 ✭✭✭MacDanger


    Good man, thanks for clarifying that for me :-)


  • Advertisement
Advertisement