R 将多个查询的结果组织到表中

R 将多个查询的结果组织到表中,r,bayesian,summarize,bayesian-networks,multiple-results,R,Bayesian,Summarize,Bayesian Networks,Multiple Results,我是一名R和编码的初学者,目前正在使用贝叶斯网络(即R)对结果进行分析。我有这段代码,生成结果作为概率及其95%的凭证间隔 这是我用来预测当前哮喘的代码的一个例子,考虑到吸烟状况和社会阶层。我想要的是一种将我从两个查询中得到的结果组织到一个表中的方法。我有大约48个查询,复制和粘贴所有查询的结果既繁琐又耗时。有什么帮助吗 ## probability of current asthma among non smoker in social class 1## > cpquery(fitte

我是一名R和编码的初学者,目前正在使用贝叶斯网络(即R)对结果进行分析。我有这段代码,生成结果作为概率及其95%的凭证间隔

这是我用来预测当前哮喘的代码的一个例子,考虑到吸烟状况和社会阶层。我想要的是一种将我从两个查询中得到的结果组织到一个表中的方法。我有大约48个查询,复制和粘贴所有查询的结果既繁琐又耗时。有什么帮助吗

## probability of current asthma among non smoker in social class 1##
> cpquery(fitted.simpler_mice_hc, event = (c_asthma == 1) , evidence = (smoking_status == 0 & sei_class==1), n=100000)

[1] 0.09212951
 
> run_1<- replicate(100, cpquery(fitted.simpler_mice_hc, event = (c_asthma == 1) , evidence = (smoking_status == 0 & sei_class==1), n=100000))
> 
> # to get the sampling quantile interval
> quantile(run_1, c(0.05,0.975))

        5%      97.5% 
0.08218354 0.09254333 

> ### non smokers in sei2, age , gender,diabtets, dust and hypertension###
> cpquery(fitted.simpler_mice_hc, event = (c_asthma == 1) , evidence = (smoking_status == 0 & sei_class==2), n=100000)
[1] 0.08623836
> 
> run_2 <- replicate(100, cpquery(fitted.simpler_mice_hc, event = (c_asthma == 1) , evidence = (smoking_status == 0 & sei_class==2), n=100000))
> 
> # to get the sampling quantile interval
> quantile(run_2, c(0.05,0.975))
        5%      97.5% 
0.08279396 0.09144179 
###社会阶层1中非吸烟者目前患哮喘的概率##
>cpquery(fitted.simpler_小鼠_hc,事件=(c_哮喘==1),证据=(吸烟状态==0和sei_等级==1),n=100000)
[1] 0.09212951
>运行1
>#获取采样分位数间隔
>分位数(run_1,c(0.05,0.975))
5%      97.5% 
0.08218354 0.09254333 
>######sei2中的非吸烟者、年龄、性别、糖尿病、灰尘和高血压###
>cpquery(fitted.simpler_小鼠_hc,事件=(c_哮喘==1),证据=(吸烟状态==0和sei_等级==2),n=100000)
[1] 0.08623836
> 
>运行2
>#获取采样分位数间隔
>分位数(run_2,c(0.05,0.975))
5%      97.5% 
0.08279396 0.09144179 
在第一个查询中,0.09212951是概率,0.08218354 0.09254333是区间下限和上限。如何将查询的区间下限和区间上限组织到表格或易于使用excel处理的内容中,而不是复制和粘贴