From 77cfd12b889b65eb3039297fef86dbfe335c5047 Mon Sep 17 00:00:00 2001 From: Judith Schepers Date: Mon, 12 Aug 2024 19:21:40 +0200 Subject: [PATCH] Effects docstring formatting --- src/effects.jl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/effects.jl b/src/effects.jl index ebef4e69..724e21ae 100644 --- a/src/effects.jl +++ b/src/effects.jl @@ -11,20 +11,19 @@ using Effects """ effects(design::AbstractDict, model::UnfoldModel; typical = mean) -Calculates marginal effects for all term-combinations in `design`. - - Implementation based on Effects Package; likely could repackage in UnfoldEffects; somebody wants to do it? This would make it easier to cross-maintain it to changes/bugfixes in the Effects.jl Package - `design` is a Dictionary containing those predictors (as keys) with levels (as values), that you want to evaluate. The `typical` refers to the value, that other predictors not in the Dictionary should take on. +Calculates marginal effects for all term combinations in `design`. +Implementation based on Effects.jl package; likely could repackage in UnfoldEffects.jl; somebody wants to do it? This would make it easier to cross-maintain it to changes/bug fixes in the Effects.jl package. +`design` is a dictionary containing those predictors (as keys) with levels (as values), that you want to evaluate. The `typical` refers to the value, which other predictors that are not specified in the dictionary, should take on. For MixedModels, the returned effects are based on the "typical" subject, i.e. all random effects are put to 0. # Example ```julia-repl julia> f = @formula 0 ~ categoricalA + continuousA + continuousB - julia> uf = fit(UnfoldModel,(Any=>(f,times)),data,events) - julia> d = Dict(:categoricalA=>["levelA","levelB"],:continuousB=>[-2,0,2]) - julia> effects(d,uf) + julia> uf = fit(UnfoldModel, (Any => (f, times)), data, events) + julia> d = Dict(:categorical => ["levelA", "levelB"], :continuous => [-2, 0, 2]) + julia> effects(d, uf) ``` will result in 6 predicted values: A/-2, A/0, A/2, B/-2, B/0, B/2. """