effectInfo: Interpretation of Effects in Linear, Logistic and Poisson...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/effectInfo.R

Description

This function provides information on interpreting effects in linear, logistic and Poisson models with transformed variables. Specifically, if a summary measure for the effect exists, the function details how to obtain it.

Usage

1
2
3
effectInfo(object)
## S3 method for class 'effectInfo'
print(x, ...)

Arguments

object

an object of class "tlm", a result of a call to tlm.

x

an object of class "effectInfo", a result of a call to effectInfo.

...

further additional arguments for the print method.

Value

beta

regression coefficient estimate in the fitted model which is associated to the effect of the explanatory variable of interest on the response variable. NA corresponds to those models for which a summary effect does not exist.

Xincrease

type of change in the exploratory variable of interest (additive or realtive) for which a summary effect exists. NA corresponds to those models for which a summary effect does not exist.

effecttype

type of effect on the response variable for which a summary effect exists. NA corresponds to those models for which a summary effect is not available.

effectsize

formula for the summary effect size, if any. NA corresponds to those models for which a summary effect is not available.

furtherinfo

further information about how to interpret effects.

Author(s)

Barrera-Gomez J and Basagana X.

References

Barrera-Gomez J, Basagana X. Models with transformed variables: interpretation and software. Epidemiology. 2015;26(2):e16-17.

See Also

tlm, effect, MY.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
### Linear model with log transformation in the explanatory variable:
data(cotinine)
head(cotinine)
# model fitting:
modcot <- tlm(y = weight, x = logcotinine, data = cotinine, xpow = 0)
modcot
# information on interpreting the effect:
effectInfo(modcot)

### Linear model with no summary measure of effect:
data(glucose)
head(glucose)
# transformations Y^(-2) and X^(-1/2): 
modgluco <- tlm(y = inv2glu, x = inv12tri, data = glucose, ypow = -2, xpow = -1/2)
modgluco
effectInfo(modgluco)

Example output

Loading required package: boot
    cotinine logcotinine weight underweight
2  5.1584035    1.640627   3626          no
5  0.2909473   -1.234613   3672          no
11 4.1119142    1.413889   3779          no
12 3.0037959    1.099877   3540          no
14 5.9240779    1.779025   3179          no
17 7.3854370    1.999510   2494         yes

Linear regression fitted model in the transformed space
-------------------------------------------------------

Transformations:
   In the explanatory variable: log 

Call:
lm(formula = weight ~ logcotinine, data = cotinine)

Coefficients:
(Intercept)  logcotinine  
       3406          -80  



The effect of X on Y can be summarized with a single number as follows:

 - Change in X: multiplicative of factor q (equivalently, adding an r = 100 * (q - 1)% to X) 
 - Type of effect on Y: additive change in the mean of Y 
 - Effect size: beta * log(q) units of Y 

   beta coefficient estimate:
             Estimate Std. Error   t value     Pr(>|t|)
logcotinine -80.00108   14.94986 -5.351292 1.584903e-07

Further details can be obtained using effect().

  trigly gluco   inv12tri      inv2glu
1    264   116 0.06154575 7.431629e-05
2    151   123 0.08137885 6.609822e-05
3     67    96 0.12216944 1.085069e-04
4     73    86 0.11704115 1.352082e-04
5    180   104 0.07453560 9.245562e-05
6    130   114 0.08770580 7.694675e-05

Linear regression fitted model in the transformed space
-------------------------------------------------------

Transformations:
   In the response variable: power, exponent = -2 
   In the explanatory variable: power, exponent = -1/2 

Call:
lm(formula = inv2glu ~ inv12tri, data = glucose)

Coefficients:
(Intercept)     inv12tri  
  5.424e-05    5.715e-04  



The effect of X on Y cannot be summarized with a single number.
Its behavior can be explored using effect().

tlm documentation built on May 2, 2019, 2:11 p.m.