ORtableGLMER: Function to compile OR-table based on GLMER with provided IDs...

Description Usage Arguments Value Examples

View source: R/ORtableGLMER.R

Description

Function to compile OR-table based on GLMER with provided IDs for grouping.

Usage

1
2
3
4
ORtableGLMER(data, this.outcome, this.ID, info, sign.digits = 2,
  sign.digits.OR = 3, pvalue.digits = 3, pvalue.cutoff = 0.001,
  test.input = FALSE, factor.level.bullet = "- ",
  less.than.character = "< ", linebreak.tag = "")

Arguments

data

A data frame that contains the data (one row per participant).

this.outcome

The name of the variable (column) in data that is the binary outcome for the logistic regression models.

this.ID

The name of the variable (column) in data that identifies the same individual/speciman. The intended use is to handle non-independence of observations from participants with repeated outcomes. This variable is used in the called lme::glmer function as part of the formula to specify a random effect.

info

A data frame with specifications for the OR-table. (See Examples below.)

sign.digits

Digits used for parameter estimate

sign.digits.OR

Digits used for odds ratio with conf.intervals

pvalue.digits

Digits used for p-values.

pvalue.cutoff

Cutoff for changing p-values to simply 'smaller than', e.g., p < 0.001.

test.input

Whether the input is tested for logical consistency. Warning: testing is not comprehensive. Setting test.input = FALSE will bypass logical tests.

factor.level.bullet

The character to be prepended to factor levels (listing). The default is factor.level.bullet = "- " (hyphen/minus) but it can be reset to any character string. If the result is passed on to html-rendering an en-dash can be produced by factor.level.bullet = "&#8211; " (HTML-code for the en-dash). Other useful options for (subsequent) HTML-rendering: factor.level.bullet = "&nbsp; &nbsp; " forces non-breaking space and effectively leads to indentation of factor levels; factor.level.bullet = "&#187; " prints right double angle quotes in HTML.

less.than.character

The character to be prepended to the cutoff-value for the p-values (e.g., '< 0.001'). The default is less.than.character = "< " but it can be reset to any character string. If the result is passed on to html-rendering this symbol can be produced by less.than.character = "&lt; " (HTML-friendly name for 'less than' since '<' is used in HTML-tags and might not render correctly as a character; e.g., when using function htmlTable() in the htmlTable-package).

linebreak.tag

Can be used to insert a linebreak-command in the table headers to bring the counts to a new line. The default is linebreak.tag = "" effectively not inserting any such command. For subsequent HTML-rendering linebreak.tag = "<br>" (HTML tag to insert a single line break) is useful.

Value

An R character-matrix containing the compiled table information.

Examples

1
2
3
4
5
   ORtableGLMER(data=example_data2, this.outcome="outc", this.ID="ID",
     info=example_variables2,
     sign.digits=2, sign.digits.OR=3, pvalue.digits=3, pvalue.cutoff=0.001,
     test.input = FALSE, factor.level.bullet = "- ",
     less.than.character = "< ", linebreak.tag = "")

FrThomas/risyphus documentation built on Dec. 6, 2019, 6:27 a.m.