MixedModels.likelihoodratiotest
— Methodlikelihoodratiotest(data, m)
Calculate likelihoodratiotest
StatsAPI.fit!
— Methodfit!(uf::UnfoldModel,data::Union{<:AbstractArray{T,2},<:AbstractArray{T,3}}) where {T<:Union{Missing, <:Number}}
Fit a DesignMatrix against a 2D/3D Array data along its last dimension Data is typically interpreted as channel x time (with basisfunctions) or channel x time x epoch (for mass univariate)
show_progress
(default:true), deactivate the progressmeter
Returns an UnfoldModel object
Examples
StatsAPI.pvalue
— Methodpvalue(lrtvec)
Unfold-Method: return pvalues of likelihoodratiotests, typically calculated:
Examples
julia> pvalue(likelihoodratiotest(m1,m2))
where m1/m2 are UnfoldLinearMixedModel's
Tipp: if you only compare two models you can easily get a vector of p-values:
julia> vcat(pvalues(likelihoodratiotest(m1,m2))...)
Multiple channels are returned linearized at the moment, as we do not have access to the amount of channels after the LRT, you can do:
julia> reshape(vcat(pvalues(likelihoodratiotest(m1,m2))...),ntimes,nchan)'
StatsModels.modelcols
— Methodmodelcols(term, tbl)
This function timeexpands the random effects and generates a ReMat object
Unfold.make_estimate
— MethodUnfold.make_estimate(m::Union{UnfoldLinearMixedModel,UnfoldLinearMixedModelContinuousTime},
) extracts betas (and sigma's for mixed models) with string grouping indicator
returns as a ch x beta, or ch x time x beta (for mass univariate)
Unfold.modelmatrices
— Methodmodelmatrices(modelmatrix::Tuple)
in the case of a Tuple (MixedModels - FeMat/ReMat Tuple), returns only the FeMat part
UnfoldMixedModels.LinearMixedModel_wrapper
— MethodLinearMixedModel_wrapper(form, data, Xs; wts)
Wrapper to generate a LinearMixedModel. Code taken from MixedModels.jl and slightly adapted.
UnfoldMixedModels.fake_lmm
— Methodfake_lmm(data, m, k)
Returns a partial LMM model (non-functional due to lacking data) to be used in likelihoodratiotests. k
to selcet which of the modelfit's to fake
UnfoldMixedModels.get_timeexpanded_random_grouping
— Methodget_timeexpanded_random_grouping(
tbl_group,
tbl_latencies,
basisfunction
)
Get the timeranges where the random grouping variable was applied
UnfoldMixedModels.isa_lmm_formula
— Methodisa_lmm_formula
iterates over all parts of a formula until either a MixedModels.zerocorr
, or a |
was found. Then returns true, else returns false.
UnfoldMixedModels.random_effect_groupings
— Methodrandom_effect_groupings(t::MixedModels.AbstractReTerm)
Returns the random effect grouping term (rhs), similar to coefnames, which returns the left hand sides
UnfoldMixedModels.reorder_tidyσs
— Methodreorder_tidyσs(t, f)
This function reorders a MixedModels.tidyσs output, according to the formula and not according to the largest RandomGrouping.