Description Usage Arguments Details Value Models Examples

View source: R/DataManagement.R

`createCyclopsData`

creates a Cyclops data object from an R formula or data matrices.

1 2 3 4 5 |

`formula` |
An object of class |

`sparseFormula` |
An object of class |

`indicatorFormula` |
An object of class |

`modelType` |
character string: Valid types are listed below. |

`data` |
An optional data frame, list or environment containing the variables in the model. |

`subset` |
Currently unused |

`weights` |
Currently unused |

`offset` |
Currently unused |

`time` |
Currently undocumented |

`pid` |
Optional vector of integer stratum identifiers. If supplied, all rows must be sorted by increasing identifiers |

`y` |
Currently undocumented |

`type` |
Currently undocumented |

`dx` |
Optional dense |

`sx` |
Optional sparse |

`ix` |
Optional {0,1} |

`model` |
Currently undocumented |

`normalize` |
String: Name of normalization for all non-indicator covariates (possible values: stdev, max, median) |

`floatingPoint` |
Integer: Floating-point representation size (32 or 64) |

`method` |
Currently undocumented |

This function creates a Cyclops model data object from R `"formula"`

or directly from
numeric vectors and matrices to define the model response and covariates.
If specifying a model using a `"formula"`

, then the left-hand side define the model response and the
right-hand side defines dense covariate terms.
Objects provided with `"sparseFormula"`

and `"indicatorFormula"`

must be include left-hand side responses and terms are
coersed into sparse and indicator representations for computational efficiency.

Items to discuss:
* Only use formula or (y,dx,...)
* stratum() in formula
* offset() in formula
* when `"stratum"`

(renamed from pid) are necessary
* when `"time"`

are necessary

A list that contains a Cyclops model data object pointer and an operation duration

Currently supported model types are:

` "ls"` | Least squares |

` "pr"` | Poisson regression |

` "lr"` | Logistic regression |

` "clr"` | Conditional logistic regression |

` "cpr"` | Conditional Poisson regression |

` "sccs"` | Self-controlled case series |

` "cox"` | Cox proportional hazards regression |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18, 17, 15, 20, 10, 20, 25, 13, 12)
outcome <- gl(3, 1, 9)
treatment <- gl(3, 3)
cyclopsData <- createCyclopsData(
counts ~ outcome + treatment,
modelType = "pr")
cyclopsFit <- fitCyclopsModel(cyclopsData)
cyclopsData2 <- createCyclopsData(
counts ~ outcome,
indicatorFormula = ~ treatment,
modelType = "pr")
summary(cyclopsData2)
cyclopsFit2 <- fitCyclopsModel(cyclopsData2)
``` |

Cyclops documentation built on Sept. 23, 2018, 5:04 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.