问题描述
我正在尝试将置信区间放入一个小标题中,以便我可以绘制它们;但是,我不断收到一条错误消息,指出维度数不正确。我已经粘贴了我的模型以及我用来尝试提取置信上限和下限的代码。请告诉我解决这个问题。
public static void main(String[] args) {
System.out.println(atanInvInt(5,99));
// 0.197395559849880758370049765194790293447585103787852101517688940241033969978243785732697828037288045
}
public static BigDecimal atanInvInt(int x,int scale) {
BigDecimal one = new BigDecimal("1");
BigDecimal two = new BigDecimal("2");
BigDecimal xVal = new BigDecimal(x);
BigDecimal xSquare = xVal.multiply(xVal);
BigDecimal divisor = new BigDecimal(1);
BigDecimal result = one.divide(xVal,scale,RoundingMode.FLOOR);
BigDecimal term = one.divide(xVal,RoundingMode.FLOOR);
BigDecimal midResult;
while (term.compareto(new BigDecimal(0)) > 0) {
term = term.divide(xSquare,RoundingMode.FLOOR);
divisor = divisor.add(two);
midResult = result.subtract(term.divide(divisor,RoundingMode.FLOOR));
term = term.divide(xSquare,RoundingMode.FLOOR);
divisor = divisor.add(two);
result = midResult.add(term.divide(divisor,RoundingMode.FLOOR));
if (divisor.compareto(new BigDecimal(2101)) >= 0) {
return result.add(midResult).divide(two,RoundingMode.FLOOR);
}
}
return result;
}
exp((fixef(mod6b)))[,1] 中的错误:维数不正确
解决方法
如何使用 def is_a_valid_date(date):
month_names = ["January","February","March","April","May","June","July","August","September","October","November","December"]
days_in_month = [31,28,31,30,31]
clean_date = date.split()
clean_date[1:] = ["".join(clean_date[1:])]
a = False
b = False
if clean_date[0] in month_names:
a = True
x = month_names.find(clean_date[0])
else:
a = a
if clean_date[1].isdigit() == True and int(clean_date[1]) <= int(days_in_month[x]):
b = True
else:
b = b
if a == True and b == True:
return True
else:
return False
? (提示,broom.mixed::tidy()
返回一个向量,而不是具有多列的对象:您是如何想到示例中显示的代码的?)
fixef()
?结果:
library(lme4)
library(broom.mixed)
library(dplyr)
## built-in example from `?glmer`
m1 <- glmer(cbind(incidence,size - incidence) ~ period + (1 | herd),family = binomial,data = cbpp)
tidy(m1,effects="fixed",conf.int=TRUE,conf.method="profile",exponentiate=TRUE) %>% select(term,estimate,conf.low,conf.high)
如果省略 term estimate conf.low conf.high
<chr> <dbl> <dbl> <dbl>
1 (Intercept) 0.247 0.149 0.388
2 period2 0.371 0.199 0.665
3 period3 0.324 0.165 0.600
4 period4 0.206 0.0820 0.449
,您将获得更快但准确度较低的 Wald 置信区间。
您可能还对 conf.method="profile"
软件包感兴趣。