Learn R Programming

card (version 0.1.0)

circ_odds: Odds Ratio Table by Time Point

Description

Creates an OR table for each time point of data given, initially applied to any grouping variable (particularly hour/time of day).

Usage

circ_odds(data, time, outcome, covar)

Arguments

data

Dataframe containing subsequent columns

time

Column name that contains the grouping variable of time

outcome

Column name that identifies the per-row outcome, binary

covar

Vector of independent variables names. First variable needs to be exposure.

Value

A data frame of odds ratios

Details

This function creates an OR table based on the covariate names supplied. It requires that there is an appropriate outcome variable selected. It performs a logistic regression. This model does not allow for conditioning variables (yet).

Examples

Run this code
# NOT RUN {
# Data
data(twins)

# Create odds ratio tables by hour of day for covariate of interest
ot <- circ_odds(twins, "hour", "sad_bin", "rDYX")

# }

Run the code above in your browser using DataLab