as_disag.data.frame | R Documentation |
Checks if a given dataframe is in the correct format for agouti functions
## S3 method for class 'data.frame'
as_disag(data, data2 = NULL, response_var, ...)
data |
A dataframe containing a outcome variable and ID variable named ID |
data2 |
A dataframe default is NULL in which case we check the data is already in the correct format. If not null, the second data frame should contain predictor variables at a different resolution to the outcome but with the same linking ID variable |
response_var |
The name of the variable containing the response data |
... |
any other arguments |
as_disag.data.frame
returns a dataframe that can be used with all agouti functions.
## Not run:
disag_data <- as_disag(data=df_outcome, data2=df_predictor, outcome="Death")
## End(Not run)
data(madagascar_malaria)
disag_data <- as_disag(data=madagascar_malaria,response_var="case_rate")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.