simple exposure analysis

Upload: ajinkya-gaikwad

Post on 02-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Simple Exposure Analysis

    1/4

  • 8/10/2019 Simple Exposure Analysis

    2/4

    10/15/2014 Simple Exposure Analysis

    http://staff.scm.uws.edu.au/~lapark/300958/labs/300958.week04.lab.html 2/4

    structure that can be manipulated. R has several forms of date structures but we will usesomething called POSIXlt. To convert from a string to POSIXlt we use the functionstrptime . Here is the code from lectures.

    > dates dates dates reach reach wreach tab colnames(tab)

  • 8/10/2019 Simple Exposure Analysis

    3/4

    10/15/2014 Simple Exposure Analysis

    http://staff.scm.uws.edu.au/~lapark/300958/labs/300958.week04.lab.html 3/4

    "65+")

    > rownames(tab) print(tab)

    Try this for your data frames, use different rows (between 1 and 158).

    Use barplot(tab, legend=TRUE, col=c("pink","lightblue")) to make a barplot.Investigate changing the colours ( col= ) and the beside= option.

    2 Manual CalculationsThe purpose of this section is to give you practice of manual calculations for confidence intervals

    for proportions and 2 tests. You shgould use your calculator to verify that you can get theseresults. If you don't have your calculator you can use R as a calculator .

    2.1 Confidence Intervals for Proportions z 0. 025 = 1. 960 and z 0. 05 = 1. 645.

    The proportion of males that reach a page is 89 out of 104 in a particular week. Finda 95% confidence interval for the proportion of males in the audience for this page.

    ANSWER: (0.789, 0.923)

    For 52 out of 200 find a 95% confidence interval for the proportion.

    ANSWER: (0.199, 0.321)

    For 441 out of 762 find a 90% confidence interval for the proportion.

    ANSWER: (0.55, 0.608)

    Your answers may be slightly different due to rounding.

    Try this in R using prop.test (remember the results may be slightly different)

    2.2 2 tests

    Find the 2 statistic and the degrees of freedom for the following tables.

  • 8/10/2019 Simple Exposure Analysis

    4/4

    10/15/2014 Simple Exposure Analysis

    http://staff.scm.uws.edu.au/~lapark/300958/labs/300958.week04.lab.html 4/4