diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 5762ae34..5ca7853f 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -21,12 +21,12 @@ on: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 with: - version: "1" + version: "1.8" - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 - name: Install dependencies diff --git a/Project.toml b/Project.toml index f668a1e0..923be0c8 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "a1dec852-9fe5-11e9-361f-8d9fde67cfa2" keywords = ["lenearmodel", "mixedmodel"] desc = "Mixed-effects models with flexible covariance structure." authors = ["Vladimir Arnautov "] -version = "0.14.7" +version = "0.14.8" [deps] DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" diff --git a/docs/Project.toml b/docs/Project.toml index a31cd3ca..bc0815a6 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,22 +1,24 @@ [deps] -Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +MixedModels = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" -CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" +StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -Documenter = "≥0.26" -Plots = "≥1" -StatsPlots = "≥0.14" +CategoricalArrays = "≥0.9, 0.10" CSV = "≥0.8" DataFrames = "≥1" +Distributions = "≥0.25" +Documenter = "≥0.26" +MixedModels = "≥4.14" +Plots = "≥1" PrettyTables = "1, 2" StatsBase = "≥0.33" -Distributions = "≥0.25" -CategoricalArrays = "≥0.9, 0.10" +StatsPlots = "≥0.14" diff --git a/docs/make.jl b/docs/make.jl index f12073ce..1ca14655 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -24,6 +24,7 @@ makedocs( "API" => "api.md", "Citation & Reference" => "ref.md", ], + checkdocs = :exports ) #= makedocs(format = DocumenterLaTeX.LaTeX(), diff --git a/docs/src/api.md b/docs/src/api.md index 313fe271..04a525ed 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -3,26 +3,31 @@ ## Basic ### @covstr + ```@docs Metida.@covstr ``` ### @lmmformula + ```@docs Metida.@lmmformula ``` ### Metida.CovarianceType + ```@docs Metida.CovarianceType ``` ### LMM + ```@docs Metida.LMM ``` ### VarEffect + ```@docs Metida.VarEffect ``` @@ -30,76 +35,91 @@ Metida.VarEffect ## Covariance structures ### Metida.Autoregressive + ```@docs Metida.Autoregressive ``` ### Metida.AutoregressiveMovingAverage + ```@docs Metida.AutoregressiveMovingAverage ``` ### Metida.CompoundSymmetry + ```@docs Metida.CompoundSymmetry ``` ### Metida.Diag + ```@docs Metida.Diag ``` ### Metida.HeterogeneousAutoregressive + ```@docs Metida.HeterogeneousAutoregressive ``` ### Metida.HeterogeneousCompoundSymmetry + ```@docs Metida.HeterogeneousCompoundSymmetry ``` ### Metida.HeterogeneousToeplitz + ```@docs Metida.HeterogeneousToeplitz ``` ### Metida.HeterogeneousToeplitzParameterized + ```@docs Metida.HeterogeneousToeplitzParameterized ``` ### Metida.ScaledIdentity + ```@docs Metida.ScaledIdentity ``` ### Metida.SpatialExponential + ```@docs Metida.SpatialExponential ``` ### Metida.SpatialGaussian + ```@docs Metida.SpatialGaussian ``` ### Metida.SpatialPower + ```@docs Metida.SpatialPower ``` ### Metida.Toeplitz + ```@docs Metida.Toeplitz ``` ### Metida.ToeplitzParameterized + ```@docs Metida.ToeplitzParameterized ``` ### Metida.Unstructured + ```@docs Metida.Unstructured ``` @@ -107,81 +127,109 @@ Metida.Unstructured ### Methods ### Metida.caic + ```@docs Metida.caic ``` +### Metida.coefn + +```@docs +Metida.coefn +``` + ### Metida.dof_satter + ```@docs Metida.dof_satter ``` ### Metida.estimate + ```@docs Metida.estimate ``` ### Metida.getlog + ```@docs Metida.getlog ``` ### Metida.gmatrix + ```@docs Metida.gmatrix ``` ### Metida.hessian + ```@docs Metida.hessian ``` ### Metida.lcontrast + ```@docs Metida.lcontrast ``` ### Metida.nblocks + ```@docs Metida.nblocks ``` ### Metida.rand + ```@docs Metida.rand ``` -### Metida.rand! +### Metida.rand + ```@docs Metida.rand! ``` ### Metida.raneff + ```@docs Metida.raneff ``` +### Metida.raneffn + +```@docs +Metida.raneffn +``` + ### Metida.rankx + ```@docs Metida.rankx ``` ### Metida.rmatrix + ```@docs Metida.rmatrix ``` ### Metida.theta + ```@docs Metida.theta ``` ### Metida.thetalength + ```@docs Metida.thetalength ``` -### Metida.vmatrix! +### Metida.vmatrix + ```@docs Metida.vmatrix! ``` @@ -189,156 +237,209 @@ Metida.vmatrix! ## StatsAPI ### Metida.aic + ```@docs Metida.aic ``` ### Metida.aicc + ```@docs Metida.aicc ``` ### Metida.bic + ```@docs Metida.bic ``` ### Metida.coef + ```@docs Metida.coef ``` ### Metida.coefnames + ```@docs Metida.coefnames ``` ### Metida.coeftable + ```@docs Metida.coeftable ``` ### Metida.confint + ```@docs Metida.confint ``` ### Metida.crossmodelmatrix + ```@docs Metida.crossmodelmatrix ``` ### Metida.dof + ```@docs Metida.dof ``` ### Metida.dof_residual + ```@docs Metida.dof_residual ``` ### Metida.fit + ```@docs Metida.fit ``` -### Metida.fit! +### Metida.fit + ```@docs Metida.fit! ``` +### islinear + +```@docs +Metida.islinear +``` + ### isfitted + ```@docs Metida.isfitted ``` ### Metida.loglikelihood + ```@docs Metida.loglikelihood ``` ### Metida.modelmatrix + ```@docs Metida.modelmatrix ``` ### Metida.nobs + ```@docs Metida.nobs ``` ### Metida.response + ```@docs Metida.response ``` ### Metida.responsename + ```@docs Metida.responsename ``` ### Metida.stderror + ```@docs Metida.stderror ``` ### Metida.vcov + ```@docs Metida.vcov ``` -## Experimental +## Experimental ### Metida.SpatialExponentialD + ```@docs Metida.SpatialExponentialD ``` ### Metida.SpatialGaussianD + ```@docs Metida.SpatialGaussianD ``` ### Metida.SpatialPowerD + ```@docs Metida.SpatialPowerD ``` ### Metida.dof_contain + ```@docs Metida.dof_contain ``` ### Metida.typeiii + ```@docs Metida.typeiii ``` -## Not API functions +### Metida.MILMM +```@docs +Metida.MILMM +``` + +## Not API functions ### Metida.contrast + ```@docs Metida.contrast ``` ### Metida.fvalue + ```@docs Metida.fvalue ``` -### Metida.mulαβαtinc! +### Metida.mulαβαtinc + ```@docs Metida.mulαβαtinc! ``` ### Metida.mulθ₃ + ```@docs Metida.mulθ₃ ``` -### Metida.mulαtβinc! +### Metida.mulαtβinc + ```@docs Metida.mulαtβinc! ``` + +### Metida.tname + +```@docs +Metida.tname +``` + +### Metida.raneflenv + +```@docs +Metida.raneflenv +``` diff --git a/docs/src/examples.md b/docs/src/examples.md index 27a0fcd9..a10e836b 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -1,13 +1,7 @@ ### Example 1 - Continuous and categorical predictors ```@example lmmexample -using Metida, CSV, DataFrames, CategoricalArrays, Plots; - -import Pkg -Pkg.activate("MixedModels") -Pkg.add(name="MixedModels", version="3.1.5") -using MixedModels - +using Metida, CSV, DataFrames, CategoricalArrays, MixedModels; rds = CSV.File(joinpath(dirname(pathof(Metida)), "..", "test", "csv", "1fptime.csv"); types = [String, String, Float64, Float64]) |> DataFrame diff --git a/docs/src/instanduse.md b/docs/src/instanduse.md index 459e987a..db11b892 100644 --- a/docs/src/instanduse.md +++ b/docs/src/instanduse.md @@ -60,7 +60,7 @@ nothing # hide Make model with `@formula` macro from `StatsModels`. Define `random` and `repreated` effects with [`Metida.VarEffect`](@ref) using [`Metida.@covstr`](@ref) macros. Left side of `@covstr` is model of effect and -right side is a effect itself. [`Metida.HeterogeneousCompoundSymmetry`](@ref) and [`Metida.Diagonal`](@ref) in example bellow is a model of variance-covariance structure. See also [`Metida.@lmmformula`](@ref) macro. +right side is a effect itself. [`Metida.HeterogeneousCompoundSymmetry`](@ref) and [`Metida.Diag`](@ref) (Diagonal) in example bellow is a model of variance-covariance structure. See also [`Metida.@lmmformula`](@ref) macro. !!! note In some cases levels of repeated effect should not be equal inside each level of subject or model will not have any sense. For example, it is assumed that usually CSH or UN (Unstructured) using with levels of repeated effect is different inside each level of subject. diff --git a/src/Metida.jl b/src/Metida.jl index 567993d2..cbbb91f3 100644 --- a/src/Metida.jl +++ b/src/Metida.jl @@ -14,7 +14,7 @@ import MetidaBase.PrettyTables: TextFormat, pretty_table, tf_borderless, ft_prin import Distributions: Normal, TDist, FDist, Chisq, MvNormal, FullNormal, ccdf, cdf, quantile import LinearAlgebra: checksquare, BlasFloat import StatsModels: @formula, termvars, ModelFrame, FunctionTerm, AbstractTerm, CategoricalTerm, AbstractContrasts, ConstantTerm, InterceptTerm, Term, InteractionTerm, FormulaTerm, ModelMatrix, schema, apply_schema, MatrixTerm, modelcols -import StatsBase: fit, fit!, coef, coefnames, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, vcov, mean, var, stderror, modelmatrix, response, responsename, CoefTable, coeftable, crossmodelmatrix +import StatsBase: fit, fit!, coef, coefnames, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, islinear, vcov, mean, var, stderror, modelmatrix, response, responsename, CoefTable, coeftable, crossmodelmatrix import Base: show, rand, ht_keyindex, getproperty import Random: default_rng, AbstractRNG, rand! @@ -33,6 +33,7 @@ TOEPHP, HeterogeneousToeplitzParameterized, SPEXP, SpatialExponential, SPPOW, SpatialPower, SPGAU, SpatialGaussian, +UN, Unstructured, CovarianceType, fit, fit!, LMM, VarEffect, theta, logreml, m2logreml, thetalength, dof_satter, dof_contain, rankx, caic, lcontrast, typeiii, estimate, contrast, gmatrix, rmatrix, vmatrix!, responsename, nblocks, raneff, @@ -40,7 +41,7 @@ AbstractCovarianceType, AbstractCovmatMethod, MetidaModel, getlog, rand, rand!, bootstrap -export coef, coefnames, coeftable, crossmodelmatrix, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, vcov, stderror, modelmatrix, response +export coef, coefnames, coeftable, crossmodelmatrix, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, islinear, vcov, stderror, modelmatrix, response num_cores() = Int(MetidaBase.num_cores()) diff --git a/src/statsbase.jl b/src/statsbase.jl index 416d5dd2..76936d2d 100644 --- a/src/statsbase.jl +++ b/src/statsbase.jl @@ -1,5 +1,6 @@ """ - islinear(model::LMM) = true + StatsBase.islinear(model::LMM) + """ StatsBase.islinear(model::LMM) = true