r - 'finalfit' loses labels when processing a continuous dependent variable
问题描述
Normally, the function finalfit
in the finalfit package shows a regression table with variable's labels.
https://finalfit.org/articles/all_tables_examples.html#cross-tables
However, when a continuous variable including large amount of missing values is used as dependent variable, the function does not show labels but variables' names.
example
library(finalfit)
library(dplyr)
colon_s %>%
finalfit("nodes", "age") # "age" has label "Age (years)"
output
Dependent is not a factor and will be treated as a continuous variable
Dependent: nodes Mean (sd) Coefficient (univariable)
1 age [18,85] 3.7 (3.6) -0.03 (-0.05 to -0.01, p=0.005)
Coefficient (multivariable)
1 -0.03 (-0.05 to -0.01, p=0.005)
Can I fix it or is it inappropriate to use continuous variables?
device information
version
_
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 6.2
year 2019
month 12
day 12
svn rev 77560
language R
version.string R version 3.6.2 (2019-12-12)
nickname Dark and Stormy Night
packageVersion("finalfit")
[1] ‘0.9.7’
packageVersion("dplyr")
[1] ‘0.8.3’
RStudio Version 1.2.5033
解决方案
Thanks.
This should work if you use finalfit 1.0.0, currently only available on github.
remotes::install_github('ewenharrison/finalfit')
library(finalfit)
colon_s %>%
finalfit("nodes", "age")
Dependent: nodes unit value Coefficient (univariable) Coefficient (multivariable)
Age (years) [18,85] Mean (sd) 3.7 (3.6) -0.03 (-0.05 to -0.01, p=0.005) -0.03 (-0.05 to -0.01, p=0.005)
Thanks again.
推荐阅读
- c# - System.IO.IOException:从传输流接收到意外的 EOF 或 0 字节
- php - 在 PHP 中,通过 CALDAV 协议在 icalendar 中添加事件时,收到未知的 HTTP 状态
- python - 如何设置芹菜生产者发送任务超时
- php - 转储函数在使用 TaggedValue 时忽略内联参数
- javascript - 错误 TS2503:找不到命名空间“WebMidi”
- pandas - KeyError:6 向 regplot 添加标签时
- android - 在 Android 启动画面的层列表中定位图像
- c++ - DirectXTK 在“SetWindow(HWND hwnd)”的“鼠标”中没有成员
- groovy - 如果在 Groovy 中返回,JaCoCo 会丢失行
- python - 无法在模板视图中使用“categories.products .all”访问数据。带有外键的 Django 模型