正在加载图片...
9 Note that both x and z contribute to y,but not w. Now run BMA program,which is downloadable from the R web site in the usual way (i.e.,from R program,use the packages menu item,find BMA,then download,and "load package") There are many functions we can use,we will illustrate simple linear regression model selection here using bicreg. output<-bicreg(data.matrix,y) output #Ca11: bicreg(x data.matrix,yy) 本 衣 Posterior probabilities(%): X1 X2 X3 #100.06.8100.0 # Coefficient posterior expected values: #(Intercept) X1 X2 X3 # 0.56763 3.19356 -0.01756 1.97760 We can also get some more info: output$postprob [1]0.931508040.06849196 output$namesx [1]"X1""X2""X3" output$label [1]"X1X3" "X1X2X3" output$r2 [1]72.71972.765 output$bic [1]-1285.164-1279.944 output$size9 # Note that both x and z contribute to y, but not w. # Now run BMA program, which is downloadable from the R web site in the # usual way (i.e., from R program, use the packages menu item, find # BMA, then download, and "load package") # There are many functions we can use, we will illustrate simple linear # regression model selection here using bicreg. output<- bicreg(data.matrix, y) output # Call: # bicreg(x = data.matrix, y = y) # # # Posterior probabilities(%): # X1 X2 X3 # 100.0 6.8 100.0 # # Coefficient posterior expected values: # (Intercept) X1 X2 X3 # 0.56763 3.19356 -0.01756 1.97760 # We can also get some more info: output$postprob [1] 0.93150804 0.06849196 output$namesx [1] "X1" "X2" "X3" output$label [1] "X1X3" "X1X2X3" output$r2 [1] 72.719 72.765 output$bic [1] -1285.164 -1279.944 output$size
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有