[https://media.ed.ac.uk/media/HealthyR+demoA+Create+table+one/1_ivx5th4k]
Day 09 of HealthyR demo
Create table one
#Task 1 Have a quick look at your data
## Rows: 207
## Columns: 7
## $ time <dbl> 10, 30, 35, 99, 185, 204, 210, 232, 232, 279, 295, 355, 386,…
## $ status <dbl> 3, 3, 2, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, …
## $ sex <dbl> 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, …
## $ age <dbl> 76, 56, 41, 71, 52, 28, 77, 60, 49, 68, 53, 64, 68, 63, 14, …
## $ year <dbl> 1972, 1968, 1977, 1968, 1965, 1971, 1972, 1974, 1968, 1971, …
## $ thickness <dbl> 6.76, 0.65, 1.34, 2.90, 12.08, 4.84, 5.16, 3.22, 12.88, 7.41…
## $ ulcer <dbl> 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $Continuous
## label var_type n missing_n missing_percent mean sd min
## time time <dbl> 205 2 1.0 2152.8 1122.1 10.0
## status status <dbl> 207 0 0.0 1.8 0.6 1.0
## sex sex <dbl> 205 2 1.0 0.4 0.5 0.0
## age age <dbl> 207 0 0.0 52.5 16.6 4.0
## year year <dbl> 205 2 1.0 1969.9 2.6 1962.0
## thickness thickness <dbl> 206 1 0.5 2.9 3.0 0.1
## ulcer ulcer <dbl> 206 1 0.5 0.4 0.5 0.0
## quartile_25 median quartile_75 max
## time 1525.0 2005.0 3042.0 5565.0
## status 1.0 2.0 2.0 3.0
## sex 0.0 0.0 1.0 1.0
## age 42.0 54.0 65.0 95.0
## year 1968.0 1970.0 1972.0 1977.0
## thickness 1.0 1.9 3.6 17.4
## ulcer 0.0 0.0 1.0 1.0
##
## $Categorical
## data frame with 0 columns and 207 rows
## Rows: 207
## Columns: 7
## $ time <dbl> 10, 30, 35, 99, 185, 204, 210, 232, 232, 279, 295, 355, 386,…
## $ status <dbl> 3, 3, 2, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, …
## $ sex <fct> Male, Male, Male, Female, Male, Male, Male, Female, Male, Fe…
## $ age <dbl> 76, 56, 41, 71, 52, 28, 77, 60, 49, 68, 53, 64, 68, 63, 14, …
## $ year <dbl> 1972, 1968, 1977, 1968, 1965, 1971, 1972, 1974, 1968, 1971, …
## $ thickness <dbl> 6.76, 0.65, 1.34, 2.90, 12.08, 4.84, 5.16, 3.22, 12.88, 7.41…
## $ ulcer <fct> Present, Absent, Absent, Absent, Present, Present, Present, …
## $Continuous
## label var_type n missing_n missing_percent mean sd min
## time time <dbl> 205 2 1.0 2152.8 1122.1 10.0
## status status <dbl> 207 0 0.0 1.8 0.6 1.0
## age age <dbl> 207 0 0.0 52.5 16.6 4.0
## year year <dbl> 205 2 1.0 1969.9 2.6 1962.0
## thickness thickness <dbl> 206 1 0.5 2.9 3.0 0.1
## quartile_25 median quartile_75 max
## time 1525.0 2005.0 3042.0 5565.0
## status 1.0 2.0 2.0 3.0
## age 42.0 54.0 65.0 95.0
## year 1968.0 1970.0 1972.0 1977.0
## thickness 1.0 1.9 3.6 17.4
##
## $Categorical
## label var_type n missing_n missing_percent levels_n
## sex sex <fct> 205 2 1.0 2
## ulcer ulcer <fct> 206 1 0.5 2
## levels levels_count levels_percent
## sex "Female", "Male", "(Missing)" 126, 79, 2 60.87, 38.16, 0.97
## ulcer "Absent", "Present", "(Missing)" 115, 91, 1 55.56, 43.96, 0.48
Research Question: Is there an association between presence of ulceration and death from melanoma
Create an example of table 1
## label levels Absent Present
## Age (years) Mean (SD) 50.6 (15.9) 54.8 (17.3)
## Sex (at birth) Female 79 (68.7) 47 (52.2)
## Male 36 (31.3) 43 (47.8)
Use the missing data dataset - how can you change your table to show/hide missingness
## label Total N levels Absent Present
## Total N (%) 115 (55.8) 91 (44.2)
## Age (years) 206 (100.0) Mean (SD) 50.6 (15.9) 54.8 (17.3)
## Sex (at birth) 205 (99.5) Female 79 (68.7) 47 (51.6)
## Male 36 (31.3) 43 (47.3)
## (Missing) 0 (0.0) 1 (1.1)
Can you change the labels? Can you add a label for the dependent variable?
## Dependent: ulcer Total N Missing N Absent Present
## Total N (%) 115 (55.8) 91 (44.2)
## Age (years) 206 (100.0) 0 Mean (SD) 50.6 (15.9) 54.8 (17.3)
## Sex (at birth) 205 (99.5) 1 Female 79 (68.7) 47 (51.6)
## Male 36 (31.3) 43 (47.3)
## (Missing) 0 (0.0) 1 (1.1)
Do you include p-values?
## Dependent: ulcer Total N Missing N Absent Present p
## Total N (%) 115 (55.8) 91 (44.2)
## Age (years) 206 (100.0) 0 Mean (SD) 50.6 (15.9) 54.8 (17.3) 0.070
## Sex (at birth) 205 (99.5) 1 Female 79 (68.7) 47 (51.6) 0.024
## Male 36 (31.3) 43 (47.3)
## (Missing) 0 (0.0) 1 (1.1)
Export
| Dependent: ulcer | Total N | Missing N | Absent | Present | p | |
|---|---|---|---|---|---|---|
| Total N (%) | 115 (55.8) | 91 (44.2) | ||||
| Age (years) | 206 (100.0) | 0 | Mean (SD) | 50.6 (15.9) | 54.8 (17.3) | 0.070 |
| Sex (at birth) | 205 (99.5) | 1 | Female | 79 (68.7) | 47 (51.6) | 0.024 |
| Male | 36 (31.3) | 43 (47.3) | ||||
| (Missing) | 0 (0.0) | 1 (1.1) |