<>$title<>

<>$intro<>

We fit a hierarchical (mixed effects) linear regression model.

The outcome (dependent) variable is:

The predictor (independent) variables are:

<>$predictorVariables<>

There are varying intercepts by subject, and the effects of all the predictors <>$includeInteractionInGroup<> are also allowed to vary <>$groupingVariable<> (these are the mixed effects). The full formula^[See the lme4 documentation (especially section 2) for explanation of the formula format.] for this model is:

<>$formula<>

Coefficient plot

These are the estimates of the effect sizes for the predictors (and interactions) in the model. The dot is the point estimate, the thick line is the 95% confidence interval, and the thin line the 99% confidence interval. One rule of thumb is: if the confidence intervals do not the effect is statistically significant.

mocapGrip:::CoefficientPlot(list(params$data[["<>$dataSet<>"]]$analyses[["<>$analysis<>"]]$bestModel[[1]]$modelObject))

Model predictions

These are predictions from the model for specific conditions. The dots are point estimates, and the lines are 95% confidence intervals.

ggplot(mocapGrip:::pred(params$data[["<>$dataSet<>"]]$analyses[["<>$analysis<>"]]$bestModel[[1]]$modelObject)) + aes(x=<>$plotPredictor1<>, y=<>$plotOutcome<>, ymin=plo, ymax=phi, group=fins, color=fins) + geom_pointrange(position = position_dodge(width=0.5)) + labs(title = "Model predictions for grip", x="stick size (in cm)", y="<>$outcomeVariable<>")

Full model output

texreg::htmlreg(list(params$data[["<>$dataSet<>"]]$analyses[["<>$analysis<>"]]$bestModel[[1]]$modelObject),
        method = "boot", # only needed for the overriding of pvalues
        use.se=TRUE, # only needed for the overriding of pvalues
        #        override.pval = list(lengthLMscaleSum$coefficients[,"Pr(>|t|)"]),
        float.pos = "p!",
        single.row=TRUE,
        caption="Hierarchical linear regression coefficient estimates and standard errors.",
        use.packas=FALSE,
        custom.model.names=c("est. (s.e.)"),
        stars = c(0.001, 0.01, 0.05, 0.1),
        star.symbol = "\\*"
)

Intercept and slope adjustments

There are estimates of the intercept and slope adjustments by subject. and 95% confidence intervals around those estimates. This is also referred to as the mixed effects structure and is one way to see variability between subjects.

mocapGrip:::ggCaterpillar(lme4::ranef(params$data[["<>$dataSet<>"]]$analyses[["<>$analysis<>"]]$bestModel[[1]]$modelObject, condVar = TRUE))

Raw data

These are the raw data that was used in the model.

ggplot(params$data[["<>$dataSet<>"]]$data) + aes(x=<>$plotPredictor1<>, y=<>$plotOutcome<>, group=fins, color=fins) + geom_point(position = position_dodge(width=0.5), alpha = 0.5) + labs(title = "Raw data for  grip", x="stick size (in cm)", y="<>$outcomeVariable<>")

Number of observations and occlusion

knitr::kable(
  params$data[["<>$dataSet<>"]]$data %>% dplyr::group_by(stick, fins) %>% dplyr::summarize(n=n(), subjs=length(unique(obsisSubj)), meanPerSubj=n/subjs)
)

if("<>$dataSet<>" %in% c("gestMove")){
  cat("#### Observations with gripType included *this is temporary*  \n The vast majority of the movements are open, with very few being open/closed. Currently, all of these (including the closed grips) are included in the analysis. We probably should exclude the closed, and possibly even the open.closed ones in the future. Thoughts?")

knitr::kable(
  params$data[["<>$dataSet<>"]]$data %>% dplyr::group_by(stick, fins, gripType) %>% dplyr::summarize(n=n(), subjs=length(unique(obsisSubj)), meanPerSubj=n/subjs)
)
}

There were r length(params$data[["<>$dataSet<>"]]$warnings) trials that were excluded because there was occlusion.

if(length(params$data[["<>$dataSet<>"]]$warnings)>0){
  # don't print anythign if there are no occlusions.
  cat(paste0("  \n* ", params$data[["<>$dataSet<>"]]$warnings, collapse = ""))
}


jonkeane/mocapGrip documentation built on May 19, 2019, 7:30 p.m.