使用rsq()函数时收到变量‘缺失’警告,是否需关注?
关于
rsq()函数警告的疑问 构建的GLM模型
model <- glm( data = df, family = binomial(link = 'logit'), formula = "Correct_Response ~ (Condition * TC_michelson_c * FC_michelson)", contrasts = list( Condition = contr.treatment(levels(df$Condition), base = TargIndex), FC_michelson = contr.sum(levels(df$FC_michelson))) )
运行rsq()时的警告
执行rsq(model, type='n')(或rsq.n)后收到如下警告:
Warning: variable 'Condition' is absent, its contrast will be ignored Warning: variable 'FC_michelson' is absent, its contrast will be ignored [1] 0.243914
部分数据示例
Condition FC_michelson TC_michelson_c Correct_Response 1 C 0.111 0.033688 0 2 Straight 0.07 0.033688 1 3 Target 0.048 0.033688 0 4 C 0.048 0.033688 0 5 BC 0.091 0.033688 0 6 BC 0.048 0.033688 0 7 Target 0.091 0.033688 0
变量结构信息
> model$data$FC_michelson %>% str() Factor w/ 4 levels "0.048","0.07",..: 4 2 1 1 3 1 3 4 2 3 ... > model$data$Condition %>% str() Factor w/ 4 levels "BC","C","Straight",..: 2 3 4 2 1 1 4 3 1 4 ... > model$data$TC_michelson_c %>% str() num [1:10080] 0.0337 0.0337 0.0337 0.0337 0.0337 ... > model$data$Correct_Response %>% str() int [1:10080] 0 1 0 0 0 0 0 0 0 0 ...
疑问
此前未使用过该函数/包,不清楚这类警告是否需要重视?
内容的提问来源于stack exchange,提问作者Harry S.
相关产品推荐
相关产品推荐

