lmFAB.Rd
FAB p-values and confidence intervals for parameters in linear regression models
lmFAB( cformula, FABvars, lformula = NULL, alpha = 0.05, rssSplit = TRUE, silent = FALSE )
cformula | formula for the control variables |
---|---|
FABvars | matrix of regressors for which to make FAB p-values and CIs |
lformula | formula for the linking model (just specify right-hand side) |
alpha | error rate for CIs (1-alpha CIs will be constructed) |
rssSplit | use some residual degrees of freedom to help fit linking model (TRUE/FALSE) |
silent | show progress (TRUE) or not (FALSE) |
an object of the class lmFAB
which inherits from lm
Peter Hoff
# n observations, p FAB variables, q=2 control variables n<-100 ; p<-25 # X is design matrix for params of interest # beta is vector of true parameter values # v a variable in the linking model - used to share info across betas v<-rnorm(p) ; beta<-(2 - 2*v + rnorm(p))/3 ; X<-matrix(rnorm(n*p),n,p)/8 # control coefficients and variables alpha1<-.5 ; alpha2<- -.5 w1<-rnorm(n)/8 w2<-rnorm(n)/8 # simulate data lp<-1 + alpha1*w1 + alpha2*w2 + X%*%beta y<-rnorm(n,lp) # fit model fit<-lmFAB(y~w1+w2,X,~v)#> #> Fitting sampling model: - Fitting sampling model: # #> Fitting linking models: #------------------------ Fitting linking models: ##----------------------- Fitting linking models: ###---------------------- Fitting linking models: ####--------------------- Fitting linking models: #####-------------------- Fitting linking models: ######------------------- Fitting linking models: #######------------------ Fitting linking models: ########----------------- Fitting linking models: #########---------------- Fitting linking models: ##########--------------- Fitting linking models: ###########-------------- Fitting linking models: ############------------- Fitting linking models: #############------------ Fitting linking models: ##############----------- Fitting linking models: ###############---------- Fitting linking models: ################--------- Fitting linking models: #################-------- Fitting linking models: ##################------- Fitting linking models: ###################------ Fitting linking models: ####################----- Fitting linking models: #####################---- Fitting linking models: ######################--- Fitting linking models: #######################-- Fitting linking models: ########################- Fitting linking models: #########################fit$FABpv#> fv1 fv2 fv3 fv4 fv5 fv6 #> 1.978805e-01 1.361665e-01 4.075199e-01 1.506357e-01 9.690238e-01 2.558704e-01 #> fv7 fv8 fv9 fv10 fv11 fv12 #> 4.681217e-02 7.755140e-01 6.491197e-02 6.306102e-05 1.048478e-01 4.693464e-01 #> fv13 fv14 fv15 fv16 fv17 fv18 #> 2.267968e-02 1.593029e-03 4.035059e-03 8.521015e-01 1.509690e-01 6.296602e-01 #> fv19 fv20 fv21 fv22 fv23 fv24 #> 9.236462e-01 8.586132e-02 2.888804e-01 7.233181e-02 2.676404e-03 6.128763e-03 #> fv25 #> 3.591399e-02fit$FABci#> [,1] [,2] #> fv1 -0.62416078 1.9355480 #> fv2 -0.36226268 1.7906871 #> fv3 -1.04268587 1.3843155 #> fv4 -0.44795417 1.9377166 #> fv5 -2.69174985 0.3900169 #> fv6 -0.69034627 1.6838984 #> fv7 0.02565909 2.6295852 #> fv8 -1.88808933 0.7045445 #> fv9 -0.09509604 2.2662999 #> fv10 0.81425697 3.7860604 #> fv11 -0.23666126 1.7295378 #> fv12 -1.14224697 1.2530837 #> fv13 0.24655613 2.4588380 #> fv14 0.87354496 2.9641694 #> fv15 0.82635953 3.4168187 #> fv16 -0.44950804 1.9910690 #> fv17 -0.45717115 1.9719745 #> fv18 -1.46496040 1.0624680 #> fv19 -2.07773894 0.2678764 #> fv20 -0.21880421 2.3281345 #> fv21 -0.69836764 1.4028975 #> fv22 -0.13792930 2.2566285 #> fv23 0.08745792 3.2401348 #> fv24 0.63758437 2.9810643 #> fv25 0.10312430 2.2352207#> #> Call: #> lm(formula = y ~ . + 0, data = as.data.frame(cbind(W, X))) #> #> Residuals: #> Min 1Q Median 3Q Max #> -1.76391 -0.35810 0.02175 0.48869 1.52693 #> #> Coefficients: #> Estimate Std. Error t value Pr(>|t+bfab|) #> `(Intercept)` 1.27882 0.09400 13.604 < 2e-16 *** #> w1 0.50868 0.94028 0.541 0.59019 #> w2 0.04075 0.67805 0.060 0.95225 #> fv1 0.65569 0.78047 0.840 0.19788 #> fv2 0.71421 0.65645 1.088 0.13617 #> fv3 0.17081 0.74001 0.231 0.40752 #> fv4 0.74488 0.72741 1.024 0.15064 #> fv5 -1.43292 0.76766 -1.867 0.96902 #> fv6 0.45145 0.69629 0.648 0.25587 #> fv7 1.32762 0.79396 1.672 0.04681 * #> fv8 -0.59177 0.79051 -0.749 0.77551 #> fv9 1.08560 0.72001 1.508 0.06491 . #> fv10 2.68679 0.67035 4.008 6.31e-05 *** #> fv11 0.74644 0.59951 1.245 0.10485 #> fv12 0.05542 0.73035 0.076 0.46935 #> fv13 1.35270 0.67454 2.005 0.02268 * #> fv14 1.91886 0.63745 3.010 0.00159 ** #> fv15 2.12159 0.78985 2.686 0.00404 ** #> fv16 0.77078 0.74415 1.036 0.85210 #> fv17 0.75740 0.74066 1.023 0.15097 #> fv18 -0.24333 0.74497 -0.327 0.62966 #> fv19 -0.96496 0.67859 -1.422 0.92365 #> fv20 1.05467 0.77658 1.358 0.08586 . #> fv21 0.35226 0.64069 0.550 0.28888 #> fv22 1.05935 0.73012 1.451 0.07233 . #> fv23 2.05198 0.72455 2.832 0.00268 ** #> fv24 1.80932 0.71454 2.532 0.00613 ** #> fv25 1.16917 0.65009 1.798 0.03591 * #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 0.7838 on 72 degrees of freedom #> Multiple R-squared: 0.8111, Adjusted R-squared: 0.7376 #> F-statistic: 11.04 on 28 and 72 DF, p-value: < 2.2e-16 #>