'finalfit' 在处理连续因变量时丢失标签
'finalfit' loses labels when processing a continuous dependent variable
通常,finalfit 包中的函数 finalfit
显示带有变量标签的回归 table。
https://finalfit.org/articles/all_tables_examples.html#cross-tables
但是,当包含大量缺失值的连续变量用作因变量时,该函数不显示标签,而是显示变量名称。
例子
library(finalfit)
library(dplyr)
colon_s %>%
finalfit("nodes", "age") # "age" has label "Age (years)"
输出
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)
我可以修复它还是使用连续变量不合适?
设备信息
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 版本 1.2.5033
谢谢。
如果您使用 finalfit 1.0.0,这应该有效,目前仅在 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)
再次感谢。
通常,finalfit 包中的函数 finalfit
显示带有变量标签的回归 table。
https://finalfit.org/articles/all_tables_examples.html#cross-tables
但是,当包含大量缺失值的连续变量用作因变量时,该函数不显示标签,而是显示变量名称。
例子
library(finalfit)
library(dplyr)
colon_s %>%
finalfit("nodes", "age") # "age" has label "Age (years)"
输出
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)
我可以修复它还是使用连续变量不合适?
设备信息
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 版本 1.2.5033
谢谢。
如果您使用 finalfit 1.0.0,这应该有效,目前仅在 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)
再次感谢。