[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-easystats--performance":3,"tool-easystats--performance":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",146793,2,"2026-04-08T23:32:35",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":92,"env_os":93,"env_gpu":94,"env_ram":94,"env_deps":95,"category_tags":106,"github_topics":110,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":120,"updated_at":121,"faqs":122,"releases":152},5779,"easystats\u002Fperformance","performance",":muscle: Models' quality and performance metrics (R2, ICC, LOO, AIC, BF, ...)","performance 是一款专为 R 语言设计的开源工具包，旨在帮助研究人员和数据分析师全面评估统计模型的质量与拟合优度。在构建回归模型时，如何科学地判断模型好坏往往令人头疼，因为相关的诊断指标（如 R²、RMSE）和检查功能通常分散在不同的软件包中，缺乏统一的标准。\n\nperformance 的出现正是为了解决这一痛点。它提供了一个集中且一致的平台，能够计算多种关键性能指标，包括决定系数（R2）、组内相关系数（ICC）、留一法交叉验证（LOO）以及贝叶斯因子（BF）等。此外，它还具备强大的诊断功能，可自动检测混合模型中的过度离散、零膨胀、收敛性问题或奇异性，让用户能快速发现模型缺陷。\n\n该工具特别适合统计学研究者、数据科学家以及需要处理复杂模型（如混合效应模型或贝叶斯模型）的开发人员使用。其核心亮点在于通用的 `r2()` 函数，能智能适配各类模型并返回最合适的拟合度指标，极大地简化了工作流程。作为 easystats 生态系统的重要组成部分，performance 让模型评估变得简单、规范且高效，是提升数据分析严谨性的得力助手。","\n# performance \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_1c7a7648e019.png' align=\"right\" height=\"139\" \u002F>\n\n[![DOI](https:\u002F\u002Fjoss.theoj.org\u002Fpapers\u002F10.21105\u002Fjoss.03139\u002Fstatus.svg)](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.03139)\n[![downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_2178ef3c5a10.png)](https:\u002F\u002Fcran.r-project.org\u002Fpackage=performance)\n[![total](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_edb0c8b8c8e2.png)](https:\u002F\u002Fcranlogs.r-pkg.org\u002F)\n\n***Test if your model is a good model!***\n\nA crucial aspect when building regression models is to evaluate the\nquality of modelfit. It is important to investigate how well models fit\nto the data and which fit indices to report. Functions to create\ndiagnostic plots or to compute fit measures do exist, however, mostly\nspread over different packages. There is no unique and consistent\napproach to assess the model quality for different kind of models.\n\nThe primary goal of the **performance** package is to fill this gap and\nto provide utilities for computing **indices of model quality** and\n**goodness of fit**. These include measures like r-squared (R2), root\nmean squared error (RMSE) or intraclass correlation coefficient (ICC) ,\nbut also functions to check (mixed) models for overdispersion,\nzero-inflation, convergence or singularity.\n\n## Installation\n\n[![CRAN](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_e11e17d68c80.png)](https:\u002F\u002Fcran.r-project.org\u002Fpackage=performance)\n[![performance status\nbadge](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_1397a207cab8.png)](https:\u002F\u002Feasystats.r-universe.dev)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Feasystats\u002Fperformance\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fapp.codecov.io\u002Fgh\u002Feasystats\u002Fperformance)\n\nThe *performance* package is available on CRAN, while its latest\ndevelopment version is available on R-universe (from *rOpenSci*).\n\n| Type | Source | Command |\n|----|----|----|\n| Release | CRAN | `install.packages(\"performance\")` |\n| Development | R-universe | `install.packages(\"performance\", repos = \"https:\u002F\u002Feasystats.r-universe.dev\")` |\n\nOnce you have downloaded the package, you can then load it using:\n\n``` r\nlibrary(\"performance\")\n```\n\n> **Tip**\n>\n> Instead of `library(performance)`, use `library(easystats)`. This will\n> make all features of the easystats-ecosystem available.\n>\n> To stay updated, use `easystats::install_latest()`.\n\n## Citation\n\nTo cite performance in publications use:\n\n``` r\ncitation(\"performance\")\n#> To cite package 'performance' in publications use:\n#> \n#>   Lüdecke et al., (2021). performance: An R Package for Assessment, Comparison and\n#>   Testing of Statistical Models. Journal of Open Source Software, 6(60), 3139.\n#>   https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.03139\n#> \n#> A BibTeX entry for LaTeX users is\n#> \n#>   @Article{,\n#>     title = {{performance}: An {R} Package for Assessment, Comparison and Testing of Statistical Models},\n#>     author = {Daniel Lüdecke and Mattan S. Ben-Shachar and Indrajeet Patil and Philip Waggoner and Dominique Makowski},\n#>     year = {2021},\n#>     journal = {Journal of Open Source Software},\n#>     volume = {6},\n#>     number = {60},\n#>     pages = {3139},\n#>     doi = {10.21105\u002Fjoss.03139},\n#>   }\n```\n\n## Documentation\n\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocumentation-performance-orange.svg?colorB=E91E63)](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002F)\n[![Blog](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fblog-easystats-orange.svg?colorB=FF9800)](https:\u002F\u002Feasystats.github.io\u002Fblog\u002Fposts\u002F)\n[![Features](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ffeatures-performance-orange.svg?colorB=2196F3)](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Findex.html)\n\nThere is a nice introduction into the package on\n[youtube](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=EPIxQ5i5oxs).\n\n## The *performance* workflow\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_3c5fef75dbf3.png\" width=\"75%\" \u002F>\n\n### Assessing model quality\n\n#### R-squared\n\n**performance** has a generic `r2()` function, which computes the\nr-squared for many different models, including mixed effects and\nBayesian regression models.\n\n`r2()` returns a list containing values related to the “most\nappropriate” r-squared for the given model.\n\n``` r\nmodel \u003C- lm(mpg ~ wt + cyl, data = mtcars)\nr2(model)\n#> # R2 for Linear Regression\n#>        R2: 0.830\n#>   adj. R2: 0.819\n\nmodel \u003C- glm(am ~ wt + cyl, data = mtcars, family = binomial)\nr2(model)\n#> # R2 for Logistic Regression\n#>   Tjur's R2: 0.705\n\nlibrary(MASS)\ndata(housing)\nmodel \u003C- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)\nr2(model)\n#>   Nagelkerke's R2: 0.108\n```\n\nThe different R-squared measures can also be accessed directly via\nfunctions like `r2_bayes()`, `r2_coxsnell()` or `r2_nagelkerke()` (see a\nfull list of functions\n[here](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Findex.html#section-r-functions)).\n\nFor mixed models, the *conditional* and *marginal* R-squared are\nreturned. The *marginal R-squared* considers only the variance of the\nfixed effects and indicates how much of the model’s variance is\nexplained by the fixed effects part only. The *conditional R-squared*\ntakes both the fixed and random effects into account and indicates how\nmuch of the model’s variance is explained by the “complete” model.\n\nFor frequentist mixed models, `r2()` (resp. `r2_nakagawa()`) computes\nthe *mean* random effect variances, thus `r2()` is also appropriate for\nmixed models with more complex random effects structures, like random\nslopes or nested random effects (Johnson 2014; Nakagawa, Johnson, and\nSchielzeth 2017).\n\n``` r\nset.seed(123)\nlibrary(rstanarm)\n\nmodel \u003C- stan_glmer(\n  Petal.Length ~ Petal.Width + (1 | Species),\n  data = iris,\n  cores = 4\n)\n\nr2(model)\n#> # Bayesian R2 with Compatibility Interval\n#> \n#>   Conditional R2: 0.954 (95% CI [0.951, 0.957])\n#>      Marginal R2: 0.414 (95% CI [0.204, 0.644])\n\nlibrary(lme4)\nmodel \u003C- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)\nr2(model)\n#> # R2 for Mixed Models\n#> \n#>   Conditional R2: 0.799\n#>      Marginal R2: 0.279\n```\n\n#### Intraclass Correlation Coefficient (ICC)\n\nSimilar to R-squared, the ICC provides information on the explained\nvariance and can be interpreted as “the proportion of the variance\nexplained by the grouping structure in the population” (Hox 2010).\n\n`icc()` calculates the ICC for various mixed model objects, including\n`stanreg` models.\n\n``` r\nlibrary(lme4)\nmodel \u003C- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)\nicc(model)\n#> # Intraclass Correlation Coefficient\n#> \n#>     Adjusted ICC: 0.722\n#>   Unadjusted ICC: 0.521\n```\n\n…and models of class `brmsfit`.\n\n``` r\nlibrary(brms)\nset.seed(123)\nmodel \u003C- brm(mpg ~ wt + (1 | cyl) + (1 + wt | gear), data = mtcars)\n```\n\n``` r\nicc(model)\n#> # Intraclass Correlation Coefficient\n#> \n#>     Adjusted ICC: 0.930\n#>   Unadjusted ICC: 0.771\n```\n\n### Model diagnostics\n\n#### Check for overdispersion\n\nOverdispersion occurs when the observed variance in the data is higher\nthan the expected variance from the model assumption (for Poisson,\nvariance roughly equals the mean of an outcome).\n`check_overdispersion()` checks if a count model (including mixed\nmodels) is overdispersed or not.\n\n``` r\nlibrary(glmmTMB)\ndata(Salamanders)\nmodel \u003C- glm(count ~ spp + mined, family = poisson, data = Salamanders)\ncheck_overdispersion(model)\n#> # Overdispersion test\n#> \n#>        dispersion ratio =    2.946\n#>   Pearson's Chi-Squared = 1873.710\n#>                 p-value =  \u003C 0.001\n```\n\nOverdispersion can be fixed by either modelling the dispersion parameter\n(not possible with all packages), or by choosing a different\ndistributional family (like Quasi-Poisson, or negative binomial, see\n(Gelman and Hill 2007)).\n\n#### Check for zero-inflation\n\nZero-inflation (in (Quasi-)Poisson models) is indicated when the amount\nof observed zeros is larger than the amount of predicted zeros, so the\nmodel is *underfitting* zeros. In such cases, it is recommended to use\nnegative binomial or zero-inflated models.\n\nUse `check_zeroinflation()` to check if zero-inflation is present in the\nfitted model.\n\n``` r\nmodel \u003C- glm(count ~ spp + mined, family = poisson, data = Salamanders)\ncheck_zeroinflation(model)\n#> # Check for zero-inflation\n#> \n#>    Observed zeros: 387\n#>   Predicted zeros: 298\n#>             Ratio: 0.77\n```\n\n#### Check for singular model fits\n\nA “singular” model fit means that some dimensions of the\nvariance-covariance matrix have been estimated as exactly zero. This\noften occurs for mixed models with overly complex random effects\nstructures.\n\n`check_singularity()` checks mixed models (of class `lme`, `merMod`,\n`glmmTMB` or `MixMod`) for singularity, and returns `TRUE` if the model\nfit is singular.\n\n``` r\nlibrary(lme4)\ndata(sleepstudy)\n\n# prepare data\nset.seed(123)\nsleepstudy$mygrp \u003C- sample(1:5, size = 180, replace = TRUE)\nsleepstudy$mysubgrp \u003C- NA\nfor (i in 1:5) {\n  filter_group \u003C- sleepstudy$mygrp == i\n  sleepstudy$mysubgrp[filter_group] \u003C-\n    sample(1:30, size = sum(filter_group), replace = TRUE)\n}\n\n# fit strange model\nmodel \u003C- lmer(\n  Reaction ~ Days + (1 | mygrp \u002F mysubgrp) + (1 | Subject),\n  data = sleepstudy\n)\n\ncheck_singularity(model)\n#> [1] TRUE\n```\n\nRemedies to cure issues with singular fits can be found\n[here](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Fcheck_singularity.html).\n\n#### Check for heteroskedasticity\n\nLinear models assume constant error variance (homoskedasticity).\n\nThe `check_heteroscedasticity()` functions assess if this assumption has\nbeen violated:\n\n``` r\ndata(cars)\nmodel \u003C- lm(dist ~ speed, data = cars)\n\ncheck_heteroscedasticity(model)\n#> Warning: Heteroscedasticity (non-constant error variance) detected (p = 0.031).\n```\n\n#### Comprehensive visualization of model checks\n\n**performance** provides many functions to check model assumptions, like\n`check_collinearity()`, `check_normality()` or\n`check_heteroscedasticity()`. To get a comprehensive check, use\n`check_model()`.\n\n``` r\n# defining a model\nmodel \u003C- lm(mpg ~ wt + am + gear + vs * cyl, data = mtcars)\n\n# checking model assumptions\ncheck_model(model)\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_0fda55a29459.png\" width=\"80%\" \u002F>\n\n### Model performance summaries\n\n`model_performance()` computes indices of model performance for\nregression models. Depending on the model object, typical indices might\nbe r-squared, AIC, BIC, RMSE, ICC or LOOIC.\n\n#### Linear model\n\n``` r\nm1 \u003C- lm(mpg ~ wt + cyl, data = mtcars)\nmodel_performance(m1)\n#> # Indices of model performance\n#> \n#> AIC     |    AICc |     BIC |    R2 | R2 (adj.) |  RMSE | Sigma\n#> ---------------------------------------------------------------\n#> 156.010 | 157.492 | 161.873 | 0.830 |     0.819 | 2.444 | 2.568\n```\n\n#### Logistic regression\n\n``` r\nm2 \u003C- glm(vs ~ wt + mpg, data = mtcars, family = \"binomial\")\nmodel_performance(m2)\n#> # Indices of model performance\n#> \n#> AIC    |   AICc |    BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP\n#> -----------------------------------------------------------------------------------------------------\n#> 31.298 | 32.155 | 35.695 |     0.478 | 0.359 | 1.000 |    0.395 |   -14.903 |           0.095 | 0.743\n```\n\n#### Linear mixed model\n\n``` r\nlibrary(lme4)\nm3 \u003C- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)\nmodel_performance(m3)\n#> # Indices of model performance\n#> \n#> AIC      |     AICc |      BIC | R2 (cond.) | R2 (marg.) |   ICC |   RMSE |  Sigma\n#> ----------------------------------------------------------------------------------\n#> 1755.628 | 1756.114 | 1774.786 |      0.799 |      0.279 | 0.722 | 23.438 | 25.592\n```\n\n### Models comparison\n\nThe `compare_performance()` function can be used to compare the\nperformance and quality of several models (including models of different\ntypes).\n\n``` r\ncounts \u003C- c(18, 17, 15, 20, 10, 20, 25, 13, 12)\noutcome \u003C- gl(3, 1, 9)\ntreatment \u003C- gl(3, 3)\nm4 \u003C- glm(counts ~ outcome + treatment, family = poisson())\n\ncompare_performance(m1, m2, m3, m4, verbose = FALSE)\n#> # Comparison of Model Performance Indices\n#> \n#> Name |   Model |  AIC (weights) | AICc (weights) |  BIC (weights) |   RMSE |  Sigma | Score_log\n#> -----------------------------------------------------------------------------------------------\n#> m1   |      lm |  156.0 (\u003C.001) |  157.5 (\u003C.001) |  161.9 (\u003C.001) |  2.444 |  2.568 |          \n#> m2   |     glm |   31.3 (>.999) |   32.2 (>.999) |   35.7 (>.999) |  0.359 |  1.000 |   -14.903\n#> m3   | lmerMod | 1764.0 (\u003C.001) | 1764.5 (\u003C.001) | 1783.1 (\u003C.001) | 23.438 | 25.592 |          \n#> m4   |     glm |   56.8 (\u003C.001) |   76.8 (\u003C.001) |   57.7 (\u003C.001) |  3.043 |  1.000 |    -2.598\n#> \n#> Name | Score_spherical |    R2 | R2 (adj.) | Tjur's R2 | Log_loss |   PCP | R2 (cond.) | R2 (marg.)\n#> ---------------------------------------------------------------------------------------------------\n#> m1   |                 | 0.830 |     0.819 |           |          |       |            |           \n#> m2   |           0.095 |       |           |     0.478 |    0.395 | 0.743 |            |           \n#> m3   |                 |       |           |           |          |       |      0.799 |      0.279\n#> m4   |           0.324 |       |           |           |          |       |            |           \n#> \n#> Name |   ICC | Nagelkerke's R2\n#> ------------------------------\n#> m1   |       |                \n#> m2   |       |                \n#> m3   | 0.722 |                \n#> m4   |       |           0.657\n```\n\n#### General index of model performance\n\nOne can also easily compute and a [**composite\nindex**](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Fcompare_performance.html#details)\nof model performance and sort the models from the best one to the worse.\n\n``` r\ncompare_performance(m1, m2, m3, m4, rank = TRUE, verbose = FALSE)\n#> # Comparison of Model Performance Indices\n#> \n#> Name |   Model |   RMSE |  Sigma | AIC weights | AICc weights | BIC weights | Performance-Score\n#> -----------------------------------------------------------------------------------------------\n#> m2   |     glm |  0.359 |  1.000 |       1.000 |        1.000 |       1.000 |           100.00%\n#> m4   |     glm |  3.043 |  1.000 |    2.96e-06 |     2.06e-10 |    1.63e-05 |            37.67%\n#> m1   |      lm |  2.444 |  2.568 |    8.30e-28 |     6.07e-28 |    3.99e-28 |            36.92%\n#> m3   | lmerMod | 23.438 | 25.592 |    0.00e+00 |     0.00e+00 |    0.00e+00 |             0.00%\n```\n\n#### Visualisation of indices of models’ performance\n\nFinally, we provide convenient visualisation (the `see` package must be\ninstalled).\n\n``` r\nplot(compare_performance(m1, m2, m4, rank = TRUE, verbose = FALSE))\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_f5fa67d24d78.png\" width=\"100%\" \u002F>\n\n### Testing models\n\n`test_performance()` (and `test_bf`, its Bayesian sister) carries out\nthe most relevant and appropriate tests based on the input (for\ninstance, whether the models are nested or not).\n\n``` r\nset.seed(123)\ndata(iris)\n\nlm1 \u003C- lm(Sepal.Length ~ Species, data = iris)\nlm2 \u003C- lm(Sepal.Length ~ Species + Petal.Length, data = iris)\nlm3 \u003C- lm(Sepal.Length ~ Species * Sepal.Width, data = iris)\nlm4 \u003C- lm(Sepal.Length ~ Species * Sepal.Width + Petal.Length + Petal.Width, data = iris)\n\ntest_performance(lm1, lm2, lm3, lm4)\n#> Name | Model |     BF | Omega2 | p (Omega2) |    LR | p (LR)\n#> ------------------------------------------------------------\n#> lm1  |    lm |        |        |            |       |       \n#> lm2  |    lm | > 1000 |   0.69 |     \u003C .001 | -6.25 | \u003C .001\n#> lm3  |    lm | > 1000 |   0.36 |     \u003C .001 | -3.44 | \u003C .001\n#> lm4  |    lm | > 1000 |   0.73 |     \u003C .001 | -7.77 | \u003C .001\n#> Each model is compared to lm1.\n\ntest_bf(lm1, lm2, lm3, lm4)\n#> Bayes Factors for Model Comparison\n#> \n#>       Model                                                    BF\n#> [lm2] Species + Petal.Length                             3.45e+26\n#> [lm3] Species * Sepal.Width                              4.69e+07\n#> [lm4] Species * Sepal.Width + Petal.Length + Petal.Width 7.58e+29\n#> \n#> * Against Denominator: [lm1] Species\n#> *   Bayes Factor Type: BIC approximation\n```\n\n### Plotting Functions\n\nPlotting functions are available through the [**see**\npackage](https:\u002F\u002Feasystats.github.io\u002Fsee\u002Farticles\u002Fperformance.html).\n\n# Code of Conduct\n\nPlease note that the performance project is released with a [Contributor\nCode of\nConduct](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002FCODE_OF_CONDUCT.html).\nBy contributing to this project, you agree to abide by its terms.\n\n# Contributing\n\nWe are happy to receive bug reports, suggestions, questions, and (most\nof all) contributions to fix problems and add features.\n\nPlease follow contributing guidelines mentioned here:\n\n\u003Chttps:\u002F\u002Feasystats.github.io\u002Fperformance\u002FCONTRIBUTING.html>\n\n## References\n\n\u003Cdiv id=\"refs\" class=\"references csl-bib-body hanging-indent\"\nentry-spacing=\"0\">\n\n\u003Cdiv id=\"ref-gelman_data_2007\" class=\"csl-entry\">\n\nGelman, Andrew, and Jennifer Hill. 2007. *Data Analysis Using Regression\nand Multilevel\u002FHierarchical Models*. Analytical Methods for Social\nResearch. Cambridge ; New York: Cambridge University Press.\n\n\u003C\u002Fdiv>\n\n\u003Cdiv id=\"ref-hox_multilevel_2010\" class=\"csl-entry\">\n\nHox, J. J. 2010. *Multilevel Analysis: Techniques and Applications*. 2nd\ned. Quantitative Methodology Series. New York: Routledge.\n\n\u003C\u002Fdiv>\n\n\u003Cdiv id=\"ref-johnson_extension_2014\" class=\"csl-entry\">\n\nJohnson, Paul C. D. 2014. “Extension of Nakagawa & Schielzeth’s R2 GLMM\nto Random Slopes Models.” Edited by Robert B. O’Hara. *Methods in\nEcology and Evolution* 5 (9): 944–46.\n\n\u003C\u002Fdiv>\n\n\u003Cdiv id=\"ref-nakagawa_coefficient_2017\" class=\"csl-entry\">\n\nNakagawa, Shinichi, Paul C. D. Johnson, and Holger Schielzeth. 2017.\n“The Coefficient of Determination R2 and Intra-Class Correlation\nCoefficient from Generalized Linear Mixed-Effects Models Revisited and\nExpanded.” *Journal of The Royal Society Interface* 14 (134): 20170213.\n\n\u003C\u002Fdiv>\n\n\u003C\u002Fdiv>\n","# performance \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_1c7a7648e019.png' align=\"right\" height=\"139\" \u002F>\n\n[![DOI](https:\u002F\u002Fjoss.theoj.org\u002Fpapers\u002F10.21105\u002Fjoss.03139\u002Fstatus.svg)](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.03139)\n[![downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_2178ef3c5a10.png)](https:\u002F\u002Fcran.r-project.org\u002Fpackage=performance)\n[![total](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_edb0c8b8c8e2.png)](https:\u002F\u002Fcranlogs.r-pkg.org\u002F)\n\n***检验你的模型是否优秀！***\n\n在构建回归模型时，评估模型拟合质量至关重要。了解模型对数据的拟合程度以及应报告哪些拟合指标非常重要。虽然已经存在用于创建诊断图或计算拟合度量的函数，但这些功能大多分散在不同的包中。对于不同类型的模型，目前尚无统一且一致的方法来评估模型质量。\n\n**performance** 包的主要目标是填补这一空白，提供用于计算**模型质量指标**和**拟合优度**的工具。这些指标包括 R 平方 (R²)、均方根误差 (RMSE) 或组内相关系数 (ICC) 等，同时也包含用于检查（混合）模型是否存在过度离散、零膨胀、收敛问题或奇异性的函数。\n\n## 安装\n\n[![CRAN](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_e11e17d68c80.png)](https:\u002F\u002Fcran.r-project.org\u002Fpackage=performance)\n[![performance 状态徽章](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_1397a207cab8.png)](https:\u002F\u002Feasystats.r-universe.dev)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Feasystats\u002Fperformance\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fapp.codecov.io\u002Fgh\u002Feasystats\u002Fperformance)\n\n*performance* 包可在 CRAN 上获取，而其最新的开发版本则可在 R-universe（由 *rOpenSci* 提供）上获得。\n\n| 类型 | 来源 | 命令 |\n|----|----|----|\n| 发布版 | CRAN | `install.packages(\"performance\")` |\n| 开发版 | R-universe | `install.packages(\"performance\", repos = \"https:\u002F\u002Feasystats.r-universe.dev\")` |\n\n下载完成后，可以使用以下命令加载该包：\n\n``` r\nlibrary(\"performance\")\n```\n\n> **提示**\n>\n> 与其使用 `library(performance)`，不如使用 `library(easystats)`。这样可以同时使用 easystats 生态系统中的所有功能。\n>\n> 若要保持更新，请使用 `easystats::install_latest()`。\n\n## 引用\n\n在出版物中引用 performance 包时，请使用以下命令：\n\n``` r\ncitation(\"performance\")\n#> 要在出版物中引用 'performance' 包，请使用：\n#> \n#>   Lüdecke 等，(2021). performance: 用于评估、比较和检验统计模型的 R 包。开放源码软件期刊，6(60)，3139。\n#>   https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.03139\n#> \n#> 对于 LaTeX 用户，BibTeX 条目如下：\n#> \n#>   @Article{,\n#>     title = {{performance}: 用于评估、比较和检验统计模型的 {R} 包},\n#>     author = {Daniel Lüdecke、Mattan S. Ben-Shachar、Indrajeet Patil、Philip Waggoner 和 Dominique Makowski},\n#>     year = {2021},\n#>     journal = {开放源码软件期刊},\n#>     volume = {6},\n#>     number = {60},\n#>     pages = {3139},\n#>     doi = {10.21105\u002Fjoss.03139},\n#>   }\n```\n\n## 文档\n\n[![文档](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocumentation-performance-orange.svg?colorB=E91E63)](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002F)\n[![博客](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fblog-easystats-orange.svg?colorB=FF9800)](https:\u002F\u002Feasystats.github.io\u002Fblog\u002Fposts\u002F)\n[![特性](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ffeatures-performance-orange.svg?colorB=2196F3)](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Findex.html)\n\n在 [youtube](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=EPIxQ5i5oxs) 上有一段关于该包的精彩介绍。\n\n## *performance* 工作流程\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_3c5fef75dbf3.png\" width=\"75%\" \u002F>\n\n### 评估模型质量\n\n#### R 平方\n\n**performance** 提供了一个通用的 `r2()` 函数，可用于计算多种不同模型的 R 平方值，包括混合效应模型和贝叶斯回归模型。\n\n`r2()` 返回一个列表，其中包含与给定模型“最适当”的 R 平方相关的值。\n\n``` r\nmodel \u003C- lm(mpg ~ wt + cyl, data = mtcars)\nr2(model)\n#> # 线性回归的 R2\n#>        R2: 0.830\n#>   adj. R2: 0.819\n\nmodel \u003C- glm(am ~ wt + cyl, data = mtcars, family = binomial)\nr2(model)\n#> # 逻辑回归的 R2\n#>   Tjur's R2: 0.705\n\nlibrary(MASS)\ndata(housing)\nmodel \u003C- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)\nr2(model)\n#>   Nagelkerke's R2: 0.108\n```\n\n此外，还可以通过诸如 `r2_bayes()`、`r2_coxsnell()` 或 `r2_nagelkerke()` 等函数直接访问不同的 R 平方度量（完整函数列表请参见 [此处](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Findex.html#section-r-functions)）。\n\n对于混合模型，会返回条件 R 平方和边际 R 平方。**边际 R 平方**仅考虑固定效应的方差，表示模型方差中有多少是由固定效应部分解释的。而**条件 R 平方**则同时考虑固定效应和随机效应，表示模型方差中有多少是由“完整”模型解释的。\n\n对于频率学派的混合模型，`r2()`（或 `r2_nakagawa()`）会计算**随机效应方差的平均值**，因此 `r2()` 也适用于具有更复杂随机效应结构的混合模型，例如随机斜率或嵌套随机效应（Johnson 2014；Nakagawa、Johnson 和 Schielzeth 2017）。\n\n``` r\nset.seed(123)\nlibrary(rstanarm)\n\nmodel \u003C- stan_glmer(\n  Petal.Length ~ Petal.Width + (1 | Species),\n  data = iris,\n  cores = 4\n)\n\nr2(model)\n#> # 兼容区间内的贝叶斯 R2\n#> \n#>   有条件的 R2: 0.954（95% CI [0.951, 0.957]）\n#>      边际的 R2: 0.414（95% CI [0.204, 0.644]）\n\nlibrary(lme4)\nmodel \u003C- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)\nr2(model)\n#> # 混合模型的 R2\n#> \n#>   有条件的 R2: 0.799\n#>      边际的 R2: 0.279\n```\n\n#### 组内相关系数 (ICC)\n\n与 R 平方类似，ICC 也提供了关于已解释方差的信息，可以被理解为“群体中由分组结构所解释的方差比例”（Hox 2010）。\n\n`icc()` 可以计算各种混合模型对象的 ICC，包括 `stanreg` 模型。\n\n``` r\nlibrary(lme4)\nmodel \u003C- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)\nicc(model)\n#> # 组内相关系数\n#> \n#>     调整后的 ICC: 0.722\n#>   未调整的 ICC: 0.521\n```\n\n以及 `brmsfit` 类型的模型。\n\n``` r\nlibrary(brms)\nset.seed(123)\nmodel \u003C- brm(mpg ~ wt + (1 | cyl) + (1 + wt | gear), data = mtcars)\n```\n\n``` r\nicc(model)\n#> # 组内相关系数\n#> \n#>     调整后的 ICC: 0.930\n#>   未调整的 ICC: 0.771\n```\n\n### 模型诊断\n\n#### 检查过度离散\n\n当数据中的观测方差高于模型假设所预期的方差时，就会出现过度离散现象（对于泊松分布而言，方差大致等于因变量的均值）。`check_overdispersion()` 函数用于检查计数模型（包括混合效应模型）是否存在过度离散。\n\n``` r\nlibrary(glmmTMB)\ndata(Salamanders)\nmodel \u003C- glm(count ~ spp + mined, family = poisson, data = Salamanders)\ncheck_overdispersion(model)\n#> # 过度离散检验\n#> \n#>        离散比 =    2.946\n#>   Pearson卡方统计量 = 1873.710\n#>                 p值 =  \u003C 0.001\n```\n\n解决过度离散的方法有两种：一是对离散参数进行建模（并非所有软件包都支持），二是选择不同的分布族（如准泊松分布或负二项分布，参见 Gelman 和 Hill, 2007）。\n\n#### 检查零膨胀\n\n在（准）泊松模型中，如果观测到的零值数量多于模型预测的零值数量，则表明存在零膨胀现象，即模型对零值的拟合不足。在这种情况下，建议使用负二项分布模型或零膨胀模型。\n\n可以使用 `check_zeroinflation()` 函数来检查拟合模型中是否存在零膨胀现象。\n\n``` r\nmodel \u003C- glm(count ~ spp + mined, family = poisson, data = Salamanders)\ncheck_zeroinflation(model)\n#> # 零膨胀检验\n#> \n#>    观测零值：387\n#>   预测零值：298\n#>             比率：0.77\n```\n\n#### 检查奇异模型拟合\n\n“奇异”模型拟合是指方差-协方差矩阵的某些维度被估计为恰好为零。这种情况通常发生在随机效应结构过于复杂的混合效应模型中。\n\n`check_singularity()` 函数用于检查混合效应模型（类为 `lme`, `merMod`, `glmmTMB` 或 `MixMod`）是否为奇异，并在模型拟合为奇异时返回 `TRUE`。\n\n``` r\nlibrary(lme4)\ndata(sleepstudy)\n\n# 准备数据\nset.seed(123)\nsleepstudy$mygrp \u003C- sample(1:5, size = 180, replace = TRUE)\nsleepstudy$mysubgrp \u003C- NA\nfor (i in 1:5) {\n  filter_group \u003C- sleepstudy$mygrp == i\n  sleepstudy$mysubgrp[filter_group] \u003C-\n    sample(1:30, size = sum(filter_group), replace = TRUE)\n}\n\n# 拟合一个奇怪的模型\nmodel \u003C- lmer(\n  Reaction ~ Days + (1 | mygrp \u002F mysubgrp) + (1 | Subject),\n  data = sleepstudy\n)\n\ncheck_singularity(model)\n#> [1] TRUE\n```\n\n修复奇异拟合问题的方法可以参考 [这里](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Fcheck_singularity.html)。\n\n#### 检查异方差性\n\n线性模型假设误差方差是恒定的（同方差性）。\n\n`check_heteroscedasticity()` 函数用于评估这一假设是否被违反：\n\n``` r\ndata(cars)\nmodel \u003C- lm(dist ~ speed, data = cars)\n\ncheck_heteroscedasticity(model)\n#> 警告：检测到异方差性（误差方差非恒定）(p = 0.031)。\n```\n\n#### 模型检验的综合可视化\n\n`performance` 包提供了许多用于检查模型假设的函数，例如 `check_collinearity()`、`check_normality()` 或 `check_heteroscedasticity()`。要进行全面的模型检验，可以使用 `check_model()`。\n\n``` r\n# 定义一个模型\nmodel \u003C- lm(mpg ~ wt + am + gear + vs * cyl, data = mtcars)\n\n# 检查模型假设\ncheck_model(model)\n```\n\n![模型检验结果](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_0fda55a29459.png)\n\n### 模型性能摘要\n\n`model_performance()` 函数用于计算回归模型的性能指标。根据模型对象的不同，常见的指标可能包括 R²、AIC、BIC、RMSE、ICC 或 LOOIC。\n\n#### 线性模型\n\n``` r\nm1 \u003C- lm(mpg ~ wt + cyl, data = mtcars)\nmodel_performance(m1)\n#> # 模型性能指标\n#> \n#> AIC     |    AICc |     BIC |    R2 | R2 (调整后) |  RMSE | Sigma\n#> ---------------------------------------------------------------\n#> 156.010 | 157.492 | 161.873 | 0.830 |     0.819 | 2.444 | 2.568\n```\n\n#### 逻辑回归模型\n\n``` r\nm2 \u003C- glm(vs ~ wt + mpg, data = mtcars, family = \"binomial\")\nmodel_performance(m2)\n#> # 模型性能指标\n#> \n#> AIC    |   AICc |    BIC | Tjur's R2 |  RMSE | Sigma | Log_loss | Score_log | Score_spherical |   PCP\n#> -----------------------------------------------------------------------------------------------------\n#> 31.298 | 32.155 | 35.695 |     0.478 | 0.359 | 1.000 |    0.395 |   -14.903 |           0.095 | 0.743\n```\n\n#### 线性混合效应模型\n\n``` r\nlibrary(lme4)\nm3 \u003C- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)\nmodel_performance(m3)\n#> # 模型性能指标\n#> \n#> AIC      |     AICc |      BIC | R2 (条件) | R2 (边际) |   ICC |   RMSE |  Sigma\n#> ----------------------------------------------------------------------------------\n#> 1755.628 | 1756.114 | 1774.786 |      0.799 |      0.279 | 0.722 | 23.438 | 25.592\n```\n\n### 模型比较\n\n`compare_performance()` 函数可用于比较多个模型（包括不同类型）的性能和质量。\n\n``` r\ncounts \u003C- c(18, 17, 15, 20, 10, 20, 25, 13, 12)\noutcome \u003C- gl(3, 1, 9)\ntreatment \u003C- gl(3, 3)\nm4 \u003C- glm(counts ~ outcome + treatment, family = poisson())\n\ncompare_performance(m1, m2, m3, m4, verbose = FALSE)\n#> # 模型性能指标比较\n#> \n#> 名称 |   模型 |  AIC (权重) | AICc (权重) |  BIC (权重) |   RMSE |  Sigma | Score_log\n#> -----------------------------------------------------------------------------------------------\n#> m1   |      lm |  156.0 (\u003C.001) |  157.5 (\u003C.001) |  161.9 (\u003C.001) |  2.444 |  2.568 |          \n#> m2   |     glm |   31.3 (>.999) |   32.2 (>.999) |   35.7 (>.999) |  0.359 |  1.000 |   -14.903\n#> m3   | lmerMod | 1764.0 (\u003C.001) | 1764.5 (\u003C.001) | 1783.1 (\u003C.001) | 23.438 | 25.592 |          \n#> m4   |     glm |   56.8 (\u003C.001) |   76.8 (\u003C.001) |   57.7 (\u003C.001) |  3.043 |  1.000 |    -2.598\n#> \n#> 名称 | Score_spherical |    R2 | R2 (adj.) | Tjur's R2 | Log_loss |   PCP | R2 (cond.) | R2 (marg.)\n#> ---------------------------------------------------------------------------------------------------\n#> m1   |                 | 0.830 |     0.819 |           |          |       |            |           \n#> m2   |           0.095 |       |           |     0.478 |    0.395 | 0.743 |            |           \n#> m3   |                 |       |           |           |          |       |      0.799 |      0.279\n#> m4   |           0.324 |       |           |           |          |       |            |           \n#> \n#> 名称 |   ICC | Nagelkerke's R2\n#> ------------------------------\n#> m1   |       |                \n#> m2   |       |                \n#> m3   | 0.722 |                \n#> m4   |       |           0.657\n```\n\n#### 模型性能综合指数\n\n还可以轻松计算模型性能的[**综合指数**](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002Freference\u002Fcompare_performance.html#details)，并按从好到坏的顺序对模型进行排序。\n\n``` r\ncompare_performance(m1, m2, m3, m4, rank = TRUE, verbose = FALSE)\n#> # 模型性能指标比较\n#> \n#> 名称 |   模型 |   RMSE |  Sigma | AIC 权重 | AICc 权重 | BIC 权重 | 性能得分\n#> -----------------------------------------------------------------------------------------------\n#> m2   |     glm |  0.359 |  1.000 |       1.000 |        1.000 |       1.000 |           100.00%\n#> m4   |     glm |  3.043 |  1.000 |    2.96e-06 |     2.06e-10 |    1.63e-05 |            37.67%\n#> m1   |      lm |  2.444 |  2.568 |    8.30e-28 |     6.07e-28 |    3.99e-28 |            36.92%\n#> m3   | lmerMod | 23.438 | 25.592 |    0.00e+00 |     0.00e+00 |    0.00e+00 |             0.00%\n```\n\n#### 模型性能指标的可视化\n\n最后，我们提供了便捷的可视化功能（需安装 `see` 包）。\n\n``` r\nplot(compare_performance(m1, m2, m4, rank = TRUE, verbose = FALSE))\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_readme_f5fa67d24d78.png\" width=\"100%\" \u002F>\n\n### 模型检验\n\n`test_performance()`（及其贝叶斯版本 `test_bf`）会根据输入内容执行最相关且适当的检验（例如，模型是否嵌套等）。\n\n``` r\nset.seed(123)\ndata(iris)\n\nlm1 \u003C- lm(Sepal.Length ~ Species, data = iris)\nlm2 \u003C- lm(Sepal.Length ~ Species + Petal.Length, data = iris)\nlm3 \u003C- lm(Sepal.Length ~ Species * Sepal.Width, data = iris)\nlm4 \u003C- lm(Sepal.Length ~ Species * Sepal.Width + Petal.Length + Petal.Width, data = iris)\n\ntest_performance(lm1, lm2, lm3, lm4)\n#> 名称 | 模型 |     BF | Omega2 | p (Omega2) |    LR | p (LR)\n#> ------------------------------------------------------------\n#> lm1  |    lm |        |        |            |       |       \n#> lm2  |    lm | > 1000 |   0.69 |     \u003C .001 | -6.25 | \u003C .001\n#> lm3  |    lm | > 1000 |   0.36 |     \u003C .001 | -3.44 | \u003C .001\n#> lm4  |    lm | > 1000 |   0.73 |     \u003C .001 | -7.77 | \u003C .001\n#> 每个模型都与 lm1 进行比较。\n\ntest_bf(lm1, lm2, lm3, lm4)\n#> 模型比较的贝叶斯因子\n#> \n#>       模型                                                    BF\n#> [lm2] Species + Petal.Length                             3.45e+26\n#> [lm3] Species * Sepal.Width                              4.69e+07\n#> [lm4] Species * Sepal.Width + Petal.Length + Petal.Width 7.58e+29\n#> \n#> * 对照模型：[lm1] Species\n#> *   贝叶斯因子类型：基于 BIC 的近似值\n```\n\n### 绘图函数\n\n绘图函数可通过[**see** 包](https:\u002F\u002Feasystats.github.io\u002Fsee\u002Farticles\u002Fperformance.html)获得。\n\n# 行为准则\n\n请注意，performance 项目遵循[贡献者行为准则](https:\u002F\u002Feasystats.github.io\u002Fperformance\u002FCODE_OF_CONDUCT.html)发布。通过参与本项目，即表示您同意遵守其条款。\n\n# 贡献说明\n\n我们欢迎 bug 报告、建议、问题，以及（最重要的是）用于修复问题和添加功能的贡献。\n\n请遵循此处提及的贡献指南：\n\n\u003Chttps:\u002F\u002Feasystats.github.io\u002Fperformance\u002FCONTRIBUTING.html>\n\n## 参考文献\n\n\u003Cdiv id=\"refs\" class=\"references csl-bib-body hanging-indent\"\nentry-spacing=\"0\">\n\n\u003Cdiv id=\"ref-gelman_data_2007\" class=\"csl-entry\">\n\nGelman, Andrew, and Jennifer Hill. 2007. *Data Analysis Using Regression\nand Multilevel\u002FHierarchical Models*. Analytical Methods for Social\nResearch. Cambridge ; New York: Cambridge University Press.\n\n\u003C\u002Fdiv>\n\n\u003Cdiv id=\"ref-hox_multilevel_2010\" class=\"csl-entry\">\n\nHox, J. J. 2010. *Multilevel Analysis: Techniques and Applications*. 2nd\ned. Quantitative Methodology Series. New York: Routledge.\n\n\u003C\u002Fdiv>\n\n\u003Cdiv id=\"ref-johnson_extension_2014\" class=\"csl-entry\">\n\nJohnson, Paul C. D. 2014. “Extension of Nakagawa & Schielzeth’s R2 GLMM\nto Random Slopes Models.” Edited by Robert B. O’Hara. *Methods in\nEcology and Evolution* 5 (9): 944–46.\n\n\u003C\u002Fdiv>\n\n\u003Cdiv id=\"ref-nakagawa_coefficient_2017\" class=\"csl-entry\">\n\nNakagawa, Shinichi, Paul C. D. Johnson, and Holger Schielzeth. 2017.\n“The Coefficient of Determination R2 and Intra-Class Correlation\nCoefficient from Generalized Linear Mixed-Effects Models Revisited and\nExpanded.” *Journal of The Royal Society Interface* 14 (134): 20170213.\n\n\u003C\u002Fdiv>\n\n\u003C\u002Fdiv>","# performance 快速上手指南\n\n`performance` 是 R 语言 `easystats` 生态系统的核心包之一，旨在提供统一、一致的方法来评估统计模型的质量。它支持线性模型、广义线性模型、混合效应模型及贝叶斯模型等多种类型，可计算 R²、ICC、RMSE 等拟合指标，并检测过离散、零膨胀、奇异性等常见问题。\n\n## 环境准备\n\n- **操作系统**：Windows、macOS 或 Linux\n- **R 版本**：建议 R ≥ 4.0.0\n- **前置依赖**：无特殊系统级依赖，但需确保已安装基础 R 环境。该包依赖多个 R 包（如 `lme4`, `glmmTMB`, `rstanarm` 等），安装时会自动处理。\n\n> 💡 提示：国内用户若遇到 CRAN 下载缓慢，可配置清华或中科大镜像源：\n> ```r\n> options(repos = c(CRAN = \"https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002FCRAN\"))\n> ```\n\n## 安装步骤\n\n### 方式一：从 CRAN 安装（稳定版）\n```r\ninstall.packages(\"performance\")\n```\n\n### 方式二：从 R-universe 安装（开发最新版）\n```r\ninstall.packages(\"performance\", repos = \"https:\u002F\u002Feasystats.r-universe.dev\")\n```\n\n### 加载包\n推荐加载整个 `easystats` 生态系统以使用全部功能：\n```r\nlibrary(easystats)\n# 或仅加载 performance\nlibrary(performance)\n```\n\n> 🔄 保持更新：定期运行 `easystats::install_latest()` 获取最新版本。\n\n## 基本使用\n\n### 1. 计算模型拟合指标（R²）\n```r\nmodel \u003C- lm(mpg ~ wt + cyl, data = mtcars)\nr2(model)\n# 输出示例：\n# # R2 for Linear Regression\n#        R2: 0.830\n#   adj. R2: 0.819\n```\n\n### 2. 检查模型假设（综合诊断）\n```r\nmodel \u003C- lm(dist ~ speed, data = cars)\ncheck_model(model)\n# 自动生成包括残差正态性、异方差性、共线性等在内的诊断图\n```\n\n### 3. 获取模型性能摘要\n```r\nm1 \u003C- lm(mpg ~ wt + cyl, data = mtcars)\nmodel_performance(m1)\n# 输出包含 AIC, BIC, R², RMSE 等关键指标的表格\n```\n\n### 4. 比较多个模型\n```r\nm2 \u003C- glm(vs ~ wt + mpg, data = mtcars, family = \"binomial\")\ncompare_performance(m1, m2)\n# 返回各模型在 AIC、BIC、R² 等指标上的对比结果\n```\n\n通过以上几步，即可快速评估你的回归模型是否“表现良好”。更多高级功能（如 ICC 计算、过离散检验、零膨胀检测等）请参考官方文档。","一位数据科学家正在构建预测城市房价的混合效应回归模型，需要向非技术背景的项目干系人证明模型的可靠性与拟合优度。\n\n### 没有 performance 时\n- **指标计算分散**：计算 R²、ICC（组内相关系数）或检查过离散度需要分别调用不同包的函数，代码繁琐且容易出错。\n- **模型类型受限**：面对复杂的混合效应模型或贝叶斯模型，基础 R 函数往往无法直接计算拟合指标，需手动编写复杂公式。\n- **诊断标准不一**：缺乏统一的接口来检查模型收敛性或奇异性，导致难以判断模型是否真正“可用”。\n- **报告效率低下**：整理多种拟合优度指标耗时费力，难以快速生成标准化的质量评估报告。\n\n### 使用 performance 后\n- **一键统一计算**：通过 `r2()` 等通用函数，仅需一行代码即可自动适配各类模型并输出 R²、RMSE 等关键指标。\n- **全面兼容复杂模型**：原生支持混合效应及贝叶斯模型，轻松计算 ICC 等专业指标，无需手动推导公式。\n- **自动化健康检查**：利用内置函数快速检测过离散度、零膨胀及收敛问题，立即识别并修复潜在模型缺陷。\n- **标准化输出流程**：直接生成结构清晰的拟合优度摘要，大幅缩短从模型构建到成果汇报的周期。\n\nperformance 将分散且复杂的模型评估工作流整合为统一、自动化的标准过程，让开发者能专注于模型优化而非指标计算。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Feasystats_performance_1c7a7648.png","easystats","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Feasystats_4321785a.png","Make R stats easy!",null,"easystats4u","https:\u002F\u002Feasystats.github.io\u002Feasystats\u002F","https:\u002F\u002Fgithub.com\u002Feasystats",[80,84],{"name":81,"color":82,"percentage":83},"R","#198CE7",96.4,{"name":85,"color":86,"percentage":87},"TeX","#3D6117",3.6,1136,104,"2026-04-02T16:10:15","GPL-3.0",1,"Linux, macOS, Windows","未说明",{"notes":96,"python":97,"dependencies":98},"该工具是 R 语言包，非 Python 工具。需安装 R 环境（建议最新版本）。可通过 CRAN 或 R-universe 安装。不支持 GPU 加速，主要依赖 CPU 进行统计模型计算。建议使用 install_latest() 保持 easystats 生态系统更新。","不适用 (基于 R 语言)",[99,100,101,102,103,104,105],"R (基础环境)","lme4","glmmTMB","rstanarm","brms","MASS","easystats (推荐生态包)",[14,52,16,107,15,13,35,108,109],"视频","其他","音频",[111,112,64,113,114,115,72,116,117,118,119],"r2","aic","models","loo","r","mixed-models","statistics","hacktoberfest","machine-learning","2026-03-27T02:49:30.150509","2026-04-09T12:33:18.585396",[123,128,133,138,142,147],{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},26202,"使用 check_model() 时遇到 'RStudio Plots 窗口太小' 或 'Variable Component is not in your data frame' 错误怎么办？","这通常是因为绘图区域不足以显示所有诊断图表。解决方案包括：\n1. 手动拉大 RStudio 的 Plots 窗口。\n2. 如果在 Rmarkdown 或 Quarto 文档中运行，调整代码块属性以增加图片尺寸，例如使用 `{r fig.height=8, fig.width=7}`。\n3. 通过减小主题的基础字体大小来缩小图表元素的绝对尺寸。","https:\u002F\u002Fgithub.com\u002Feasystats\u002Fperformance\u002Fissues\u002F536",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},26203,"performance 包是否支持 psych 包中的 EFA（探索性因子分析）或 PCA（主成分分析）模型？","目前 `model_performance()` 函数尚不支持 `psych` 包生成的对象（会返回 NULL 并提示不支持）。虽然社区已提出增强请求以支持提取如 RMSEA、TLI、BIC 等指标，但截至当前版本仍需等待官方更新。用户需注意 PCA 仅是降维技术（生成复合变量），而因子分析（EFA\u002FCFA）包含潜在变量和测量误差假设，两者在统计意义上有根本区别。","https:\u002F\u002Fgithub.com\u002Feasystats\u002Fperformance\u002Fissues\u002F793",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},26204,"binned_residuals() 函数中不同的 ci_type 参数（如 exact, gaussian, boot）有什么区别？","`binned_residuals()` 允许通过 `ci_type` 参数指定置信区间的计算方法：\n- `ci_type = \"exact\"`：使用精确的二项式置信区间（基于 `binom.test`）。\n- `ci_type = \"gaussian\"`：使用基于正态分布近似的置信区间。\n- `ci_type = \"boot\"`：使用自助法（Bootstrap）计算置信区间。\n此外，可以通过 `residuals` 参数选择残差类型（如 \"response\" 或 \"deviance\"），并通过 `show_dots = TRUE` 显示原始数据点。","https:\u002F\u002Fgithub.com\u002Feasystats\u002Fperformance\u002Fissues\u002F382",{"id":139,"question_zh":140,"answer_zh":141,"source_url":137},26205,"在使用 binned_residuals() 时遇到 'restarting interrupted promise evaluation' 警告或最后一个分箱范围不重叠的问题是什么原因？","这通常是由于内部计算逻辑导致的。具体原因是 `stats:::binom.test()` 返回的是一个长度为 2 的向量（置信区间的上下限），而拟合值（fv）是一个长向量，直接相减会导致向量长度不匹配从而引发警告或绘图异常。维护者建议检查相关代码逻辑或等待修复，目前可尝试更换 `ci_type` 参数（如改用 \"gaussian\"）来规避该问题。",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},26206,"compare_performance() 如何处理响应变量经过变换（如 log(y), sqrt(y)）的模型比较？","对于许多变换（如对数变换），函数现在可以通过计算雅可比行列式（Jacobian）来调整对数似然值（log-likelihood）、信息准则（IC）、R^2 和 sigma 等指标，从而实现不同变换响应变量模型之间的公平比较。目前该功能已更新，应该能够自动检测并处理如 `log(y)` 等情况，将雅可比校正项“加”到对数似然值上，而不是替换它。","https:\u002F\u002Fgithub.com\u002Feasystats\u002Fperformance\u002Fissues\u002F372",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},26207,"在引用 performance 包的 JOSS 论文时，如何避免标题大小写导致的引用格式错误？","由于某些引用工具会自动将标题首字母大写，导致包名 'performance' 被错误地写成 'Performance'，建议在引用时明确使用单引号包裹包名，或者采用如下标题格式以避免歧义：\n- `The 'performance' R Package for Assessment, Comparison and Testing of Statistical Models`\n- 或 `Assessment, Comparison and Testing of Statistical Models Using the 'performance' R Package`。\n同时，请检查参考文献中的 DOI 是否正确，并注意 JOSS 评审列表中可能存在的标题拼写错误（如多余数字）。","https:\u002F\u002Fgithub.com\u002Feasystats\u002Fperformance\u002Fissues\u002F221",[153,158,163,168,173,178,183,188,193,198,203,208,213,218,223,228,233,238,243,248],{"id":154,"version":155,"summary_zh":156,"released_at":157},163594,"v0.16.0","## 破坏性变更\n\n* `model_performance()` 函数用于 psych FA 对象时，现将指标名称正确地命名为 `RMSR`（均方根残差），而非 `RMSA`。同时，`RMSR_corrected` 列（之前名为 `RMSA_corrected`）也相应重命名。\n\n* `check_model()`、`check_predictions()` 和 `check_convergence()` 函数的第一个参数已更名为 `model`。\n\n## 变更\n\n* `check_model()` 现在通过 `maximum_dots` 参数限制具有大量观测值的模型的数据点数量，以缩短绘图所需的时间。\n\n* `check_model()` 现可通过 `show_ci` 参数显示或隐藏置信区间。对于仅包含分类预测变量的模型，置信区间默认不显示。\n\n## 错误修复\n\n* 修复了 `check_dag()` 中处理多个碰撞器时的问题。\n\n* 修复了 CRAN 检查中的问题。\n","2026-02-04T12:48:56",{"id":159,"version":160,"summary_zh":161,"released_at":162},163595,"v0.15.3","* `check_autocorrelation()` 为 `DHARMa` 对象以及由 `simulate_residuals()` 生成的对象提供了方法。\n\n* 改进了打印方法的文档。","2025-12-01T12:59:26",{"id":164,"version":165,"summary_zh":166,"released_at":167},163596,"v0.15.2","## 错误修复\r\n\r\n* 修复了与最新 *rstanarm* 更新相关的 CRAN 检查失败问题。","2025-10-06T12:22:00",{"id":169,"version":170,"summary_zh":171,"released_at":172},163597,"v0.15.1","## 变更\r\n\r\n* `display()` 现在支持 `tinytable` 格式，当 `format = \"tt\"` 时。\r\n\r\n* 在 `model_performance()` 中更好地处理未收敛的 lavaan 模型。","2025-08-30T19:06:02",{"id":174,"version":175,"summary_zh":176,"released_at":177},163598,"v0.15.0","## 新功能\n\n* `item_omega()`，用于计算麦克唐纳Omega信度系数。\n\n* `item_totalcor()` 计算某个题项与量表中所有其他题项总和之间的总相关。若 `corrected = TRUE`，则会根据量表中的题项数量对总相关进行校正（这等同于 `item_discrimination()`）。\n\n* `item_reliability()` 的列名已更改，以符合 _easystats_ 的命名规范，并与其他相关函数的输出保持一致。\n\n## 变更\n\n* `check_itemscale()` 现在可以处理来自 `parameters::factor_analysis()` 的因子分析结果。\n\n* `item_reliability()` 的打印输出现在包含题项-总分相关、克隆巴赫α系数以及平均题项间相关的信息。\n\n* `cronbachs_alpha()` 现在可以处理来自 `parameters::factor_analysis()` 的因子分析结果。\n\n* `test_likelihoodratio()` 中 p 值的格式现已与其他函数的格式化 p 值保持一致。\n\n* 为 `psych::fa()`、`psych::principal()`、`item_omega()`、`psych::omega()` 和 `parameters::factor_analysis()` 添加了以下方法：`check_normality()`、`check_residuals()`、`check_outliers()` 和 `model_performance()`。\n\n* 添加了 `item_alpha()` 作为 `cronbachs_alpha()` 的别名。\n\n* 更多函数新增了 `display()`、`print_md()` 和 `print_html()` 方法。\n\n## 错误修复\n\n* 修复了 `check_predictions()` 中针对响应变量定义为比例或成功与试验次数矩阵的二项式模型的问题。\n\n* `check_itemscale()` 返回对象的 `print_md()` 输出现在包含页脚，其中包含克隆巴赫α系数和平均题项间相关的相关信息。","2025-07-10T12:59:07",{"id":179,"version":180,"summary_zh":181,"released_at":182},163599,"v0.14.0","## 破坏性变更\n\n* `check_collinearity()` 输出中的 `\"Increased SE\"` 列已重命名为 `\"adj. VIF\"`（即调整后的方差膨胀因子）。此外，调整后 VIF 的计算现在能够正确考虑因子的水平数（即自由度）。\n\n## 新函数\n\n* 新增函数 `check_group_variation()`，用于检查组内和组间变异（此函数将在未来版本中取代 `check_heterogeneity_bias()`）。\n\n* 新增函数 `performance_reliability()` 和 `performance_dvour()`。这些函数提供关于混合效应模型中组水平估计值（即随机效应）可靠性的信息。\n\n## 变更\n\n* 使用 `check_singularity()` 进行奇异性检查现在更加高效，并且还包括来自 *glmmTMB* 包的离散成分的随机效应。此外，新增的 `check` 参数可用于检查整个模型的总体奇异性，或分别返回每个随机效应项的奇异性检查结果。\n\n## 错误修复\n\n* 修复了某些模型中伪 R² 计算错误的问题。此前，基础模型（零模型）会使用原始数据更新，而原始数据可能包含缺失值，从而导致伪 R² 计算不准确。现改为使用模型框架，确保返回的基础模型具有正确的观测值数量，进而正确计算对数似然并返回正确的伪 R² 值。\n\n* 修复了 `check_outliers()` 中的示例代码。","2025-05-22T14:44:18",{"id":184,"version":185,"summary_zh":186,"released_at":187},163600,"v0.13.0","## 破坏性变更\n\n* 当 `check_outliers()` 的 `method = \"optics\"` 时，现在会通过将 `optics_xi` 参数传递给 `dbscan::extractXi()`，返回一个更加精细的聚类选择。\n\n* 已移除已弃用的参数和别名函数名。\n\n* 在 `check_model()` 中，用于指代绘图美学的参数名（如 `dot_size`）现已在 *easystats* 包之间实现统一，即这些参数已被重命名。它们现在遵循 `aesthetic_type` 的命名模式，例如 `size_dot`（而非 `dot_size`）。\n\n## 变更\n\n* 提高了 `check_convergence()` 对 *glmmTMB* 模型的准确性。\n\n* `r2()` 和 `r2_mcfadden()` 现在支持来自 *glmmTMB* 包的贝塔二项式（非混合）模型。\n\n* 为 `performance_roc` 类的对象添加了 `as.numeric()` 和 `as.double()` 方法。\n\n* 改进了 `performance_roc()` 的文档。\n\n## 错误修复\n\n* 当只有响应变量为数值型，而所有相关预测变量都不是数值型时，`check_outliers()` 并不会发出未找到数值变量的警告。\n\n* 当零膨胀成分设置为 `~0` 时，`check_collinearity()` 无法用于 *glmmTMB* 模型。","2025-01-15T14:40:01",{"id":189,"version":190,"summary_zh":191,"released_at":192},163601,"v0.12.4","## 变更\r\n\r\n* `check_dag()` 现在也会检查碰撞节点，并在打印输出中建议将其移除。\r\n\r\n* 对 `check_dag()` 的打印输出进行了小幅修订。\r\n\r\n## 错误修复\r\n\r\n* 修复了因最新 *glmmTMB* 更新而导致失败的测试。","2024-10-18T18:40:36",{"id":194,"version":195,"summary_zh":196,"released_at":197},163602,"v0.12.3","## 新功能\r\n\r\n* `check_dag()`，用于检查因果图中是否正确指定了调整集。\r\n\r\n## 变更\r\n\r\n* `check_heterogeneity_bias()` 增加了 `nested` 参数。此外，`by` 参数 now 可以指定多个变量，这意味着嵌套或交叉分类的设计也可以用来检验异质性偏误。","2024-09-02T18:04:37",{"id":199,"version":200,"summary_zh":201,"released_at":202},163603,"v0.12.2","补丁版本，以确保 _performance_ 能在 Mac OS X 上使用 R（旧版本）和较旧版本的 _datawizard_ 正常运行。","2024-07-18T12:59:04",{"id":204,"version":205,"summary_zh":206,"released_at":207},163604,"v0.12.1","## General\r\n\r\n* `icc()` and `r2_nakagawa()` get a `null_model` argument. This can be useful\r\n  when computing R2 or ICC for mixed models, where the internal computation of\r\n  the null model fails, or when you already have fit the null model and want\r\n  to save time.\r\n\r\n* `icc()` and `r2_nakagawa()` get a `approximation` argument indicating the\r\n  approximation method for the distribution-specific (residual) variance. See\r\n  Nakagawa et al. 2017 for details.\r\n\r\n* `icc()` and `r2_nakagawa()` get a `model_component` argument indicating the\r\n  component for zero-inflation or hurdle models.\r\n\r\n* `performance_rmse()` (resp. `rmse()`) can now compute analytical and\r\n  bootstrapped confidence intervals. The function gains following new arguments:\r\n  `ci`, `ci_method` and `iterations`.\r\n\r\n* New function `r2_ferrari()` to compute Ferrari & Cribari-Neto's R2 for\r\n  generalized linear models, in particular beta-regression.\r\n\r\n* Improved documentation of some functions.\r\n\r\n## Bug fixes\r\n\r\n* Fixed issue in `check_model()` when model contained a transformed response\r\n  variable that was named like a valid R function name (e.g., `lm(log(lapply) ~ x)`,\r\n  when data contained a variable named `lapply`).\r\n\r\n* Fixed issue in `check_predictions()` for linear models when response was\r\n  transformed as ratio (e.g. `lm(succes\u002Ftrials ~ x)`).\r\n\r\n* Fixed issue in `r2_bayes()` for mixed models from *rstanarm*.\r\n","2024-07-15T17:00:18",{"id":209,"version":210,"summary_zh":211,"released_at":212},163605,"v0.12.0","## Breaking\r\n\r\n* Aliases `posterior_predictive_check()` and `check_posterior_predictions()` for\r\n  `check_predictions()` are deprecated.\r\n\r\n* Arguments named `group` or `group_by` will be deprecated in a future release.\r\n  Please use `by` instead. This affects `check_heterogeneity_bias()` in\r\n  *performance*.\r\n\r\n## General\r\n\r\n* Improved documentation and new vignettes added.\r\n\r\n* `check_model()` gets a `base_size` argument, to set the base font size for plots. \r\n\r\n* `check_predictions()` for `stanreg` and `brmsfit` models now returns plots in\r\n  the usual style as for other models and no longer returns plots from\r\n  `bayesplot::pp_check()`.\r\n\r\n* Updated the trained model that is used to prediction distributions in\r\n  `check_distribution()`.\r\n\r\n## Bug fixes\r\n\r\n* `check_model()` now falls back on normal Q-Q plots when a model is not supported\r\n  by the DHARMa package and simulated residuals cannot be calculated.","2024-06-09T06:43:56",{"id":214,"version":215,"summary_zh":216,"released_at":217},163606,"v0.11.0","## New supported models\r\n\r\n* Rudimentary support for models of class `serp` from package *serp*.\r\n\r\n## New functions\r\n\r\n* `simulate_residuals()` and `check_residuals()`, to simulate and check residuals\r\n  from generalized linear (mixed) models. Simulating residuals is based on the\r\n  DHARMa package, and objects returned by `simulate_residuals()` inherit from\r\n  the `DHARMa` class, and thus can be used with any functions from the *DHARMa*\r\n  package. However, there are also implementations in the *performance* package,\r\n  such as `check_overdispersion()`, `check_zeroinflation()`, `check_outliers()`\r\n  or `check_model()`.\r\n\r\n* Plots for `check_model()` have been improved. The Q-Q plots are now based\r\n  on simulated residuals from the DHARMa package for non-Gaussian models, thus\r\n  providing more accurate and informative plots. The half-normal QQ plot for\r\n  generalized linear models can still be obtained by setting the new argument\r\n  `residual_type = \"normal\"`.\r\n\r\n* Following functions now support simulated residuals (from `simulate_residuals()`)\r\n  resp. objects returned from `DHARMa::simulateResiduals()`:\r\n  - `check_overdispersion()`\r\n  - `check_zeroinflation()`\r\n  - `check_outliers()`\r\n  - `check_model()`\r\n\r\n## General\r\n\r\n* Improved error messages for `check_model()` when QQ-plots cannot be created.\r\n\r\n* `check_distribution()` is more stable for possibly sparse data.\r\n\r\n## Bug fixes\r\n\r\n* Fixed issue in `check_normality()` for t-tests.\r\n\r\n* Fixed issue in `check_itemscale()` for data frame inputs, when `factor_index`\r\n  was not a named vector.","2024-03-23T08:06:51",{"id":219,"version":220,"summary_zh":221,"released_at":222},163607,"v0.10.9","## Changes\r\n\r\n* `r2()` for models of class `glmmTMB` without random effects now returns the\r\n  correct r-squared value for non-mixed models.\r\n\r\n* `check_itemscale()` now also accepts data frames as input. In this case,\r\n  `factor_index` must be specified, which must be a numeric vector of same\r\n  length as number of columns in `x`, where each element is the index of the\r\n  factor to which the respective column in `x`.\r\n\r\n* `check_itemscale()` gets a `print_html()` method.\r\n\r\n* Clarification in the documentation of the `estimator` argument for\r\n  `performance_aic()`.\r\n\r\n* Improved plots for overdispersion-checks for negative-binomial models from\r\n  package *glmmTMB* (affects `check_overdispersion()` and `check_mnodel()`).\r\n\r\n* Improved detection rates for singularity in `check_singularity()` for models\r\n  from package *glmmTMB*.\r\n\r\n* For model of class `glmmTMB`, deviance residuals are now used in the\r\n  `check_model()` plot.\r\n\r\n* Improved (better to understand) error messages for `check_model()`,\r\n  `check_collinearity()` and `check_outliers()` for models with non-numeric\r\n  response variables.\r\n\r\n* `r2_kullback()` now gives an informative error for non-supported models.\r\n\r\n## Bug fixes\r\n\r\n* Fixed issue in `binned_residuals()` for models with binary outcome, where\r\n  in rare occasions empty bins could occur.\r\n\r\n* `performance_score()` should no longer fail for models where scoring rules\r\n  can't be calculated. Instead, an informative message is returned.\r\n\r\n* `check_outliers()` now properly accept the `percentage_central` argument when\r\n  using the `\"mcd\"` method.\r\n\r\n* Fixed edge cases in `check_collinearity()` and `check_outliers()` for models\r\n  with response variables of classes `Date`, `POSIXct`, `POSIXlt` or `difftime`.\r\n\r\n* Fixed issue with `check_model()` for models of package *quantreg*.","2024-02-17T18:09:39",{"id":224,"version":225,"summary_zh":226,"released_at":227},163608,"v0.10.8","## Changes\r\n\r\n* Changed behaviour of `check_predictions()` for models from binomial family,\r\n  to get comparable plots for different ways of outcome specification. Now,\r\n  if the outcome is a proportion, or defined as matrix of trials and successes,\r\n  the produced plots are the same (because the models should be the same, too).\r\n\r\n## Bug fixes\r\n\r\n* Fixed CRAN check errors.\r\n\r\n* Fixed issue with `binned_residuals()` for models with binomial family, where\r\n  the outcome was a proportion.","2023-10-30T09:25:11",{"id":229,"version":230,"summary_zh":231,"released_at":232},163609,"v0.10.7","## Breaking changes\r\n\r\n* `binned_residuals()` gains a few new arguments to control the residuals used\r\n  for the test, as well as different options to calculate confidence intervals\r\n  (namely, `ci_type`, `residuals`, `ci` and `iterations`). The default values\r\n  to compute binned residuals have changed. Default residuals are now \"deviance\"\r\n  residuals (and no longer \"response\" residuals). Default confidence intervals\r\n  are now \"exact\" intervals (and no longer based on Gaussian approximation).\r\n  Use `ci_type = \"gaussian\"` and `residuals = \"response\"` to get the old defaults.\r\n\r\n## Changes to functions\r\n\r\n* `binned_residuals()` - like `check_model()` - gains a `show_dots` argument to\r\n  show or hide data points that lie inside error bounds. This is particular\r\n  useful for models with many observations, where generating the plot would be\r\n  very slow.","2023-10-28T06:47:59",{"id":234,"version":235,"summary_zh":236,"released_at":237},163610,"v0.10.6","## General \r\n\r\n* Support for `nestedLogit` models.\r\n\r\n## Changes to functions\r\n\r\n* `check_outliers()` for method `\"ics\"` now detects number of available cores\r\n  for parallel computing via the `\"mc.cores\"` option. This is more robust than\r\n  the previous method, which used `parallel::detectCores()`. Now you should\r\n  set the number of cores via `options(mc.cores = 4)`.\r\n\r\n## Bug fixes\r\n\r\n* Fixed issues is `check_model()` for models that used data sets with\r\n  variables of class `\"haven_labelled\"`.","2023-10-05T15:02:10",{"id":239,"version":240,"summary_zh":241,"released_at":242},163611,"v0.10.5","## Changes to functions\r\n\r\n* More informative message for `test_*()` functions that \"nesting\" only refers\r\n  to fixed effects parameters and currently ignores random effects when detecting\r\n  nested models.\r\n\r\n* `check_outliers()` for `\"ICS\"` method is now more stable and less likely to\r\n  fail.\r\n\r\n* `check_convergence()` now works for *parsnip* `_glm` models.\r\n\r\n## Bug fixes\r\n\r\n* `check_collinearity()` did not work for hurdle- or zero-inflated models of\r\n  package *pscl* when model had no explicitly defined formula for the\r\n  zero-inflation model.","2023-09-12T09:28:34",{"id":244,"version":245,"summary_zh":246,"released_at":247},163612,"v0.10.4","* `icc()` and `r2_nakagawa()` gain a `ci_method` argument, to either calculate\r\n  confidence intervals using `boot::boot()` (instead of `lmer::bootMer()`) when\r\n  `ci_method = \"boot\"` or analytical confidence intervals\r\n  (`ci_method = \"analytical\"`). Use `ci_method = \"boot\"` when the default method\r\n  fails to compute confidence intervals and use `ci_method = \"analytical\"` if\r\n  bootstrapped intervals cannot be calculated at all. Note that the default\r\n  computation method is preferred.\r\n\r\n* `check_predictions()` accepts a `bandwidth` argument (smoothing bandwidth),\r\n  which is passed down to the `plot()` methods density-estimation.\r\n\r\n* `check_predictions()` gains a `type` argument, which is passed down to the\r\n  `plot()` method to change plot-type (density or discrete dots\u002Fintervals).\r\n  By default, `type` is set to `\"default\"` for models without discrete outcomes,\r\n  and else `type = \"discrete_interval\"`.\r\n\r\n* `performance_accuracy()` now includes confidence intervals, and reports those\r\n  by default (the standard error is no longer reported, but still included).\r\n\r\n## Bug fixes\r\n\r\n* Fixed issue in `check_collinearity()` for _fixest_ models that used `i()`\r\n  to create interactions in formulas.\r\n","2023-06-02T11:43:55",{"id":249,"version":250,"summary_zh":251,"released_at":252},163613,"v0.10.3","## New functions\r\n\r\n* `item_discrimination()`, to calculate the discrimination of a scale's items.\r\n\r\n## Support for new models\r\n\r\n* `model_performance()`, `check_overdispersion()`, `check_outliers()` and `r2()`\r\n  now work with objects of class `fixest_multi` (@etiennebacher, #554).\r\n  \r\n* `model_performance()` can now return the \"Weak instruments\" statistic and\r\n  p-value for models of class `ivreg` with `metrics = \"weak_instruments\"`\r\n  (@etiennebacher, #560).\r\n\r\n* Support for `mclogit` models.\r\n\r\n## Changes to functions\r\n\r\n* `test_*()` functions now automatically fit a null-model when only one model\r\n  objects was provided for testing multiple models.\r\n\r\n* Warnings in `model_performance()` for unsupported objects of class\r\n  `BFBayesFactor` can now be suppressed with `verbose = FALSE`.\r\n\r\n* `check_predictions()` no longer fails with issues when `re_formula = NULL`\r\n  for mixed models, but instead gives a warning and tries to compute posterior\r\n  predictive checks with `re_formuka = NA`.\r\n\r\n* `check_outliers()` now also works for meta-analysis models from packages\r\n  *metafor* and *meta*.\r\n\r\n* `plot()` for `performance::check_model()` no longer produces a normal QQ plot\r\n  for GLMs. Instead, it now shows a half-normal QQ plot of the absolute value\r\n  of the standardized deviance residuals.\r\n\r\n## Bug fixes\r\n\r\n* Fixed issue in `print()` method for `check_collinearity()`, which could mix\r\n  up the correct order of parameters.","2023-04-07T18:30:02"]