Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Made up data
- x1 = c(0.051,0.049,0.046,0.042,0.042,0.041,0.038,0.037,0.043,0.031)
- x2 = c(0.11,0.12,0.09,0.21,0.18,0.11,0.13,0.11,0.08,0.10)
- y = c(0.97,0.87,0.77,0.65,0.77,0.84,0.76,0.73,0.82,0.90)
- data = data.frame(x1,x2,y)
- # run beta regression on data using loglog link
- regression.beta = betareg(y ~ x1 + x2, link = "loglog")
- # summarise result:
- summary(regression.beta)
- Call:
- betareg(formula = y ~ x1 + x2, link = "loglog")
- Standardized weighted residuals 2:
- Min 1Q Median 3Q Max
- -1.4901 -0.8370 -0.2718 0.2740 2.6258
- Coefficients (mean model with loglog link):
- Estimate Std. Error z value Pr(>|z|)
- (Intercept) 1.234 1.162 1.062 0.2882
- x1 31.814 26.715 1.191 0.2337
- x2 -7.776 3.276 -2.373 0.0176 *
- Phi coefficients (precision model with identity link):
- Estimate Std. Error z value Pr(>|z|)
- (phi) 24.39 10.83 2.252 0.0243 *
- ---
- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
- Type of estimator: ML (maximum likelihood)
- Log-likelihood: 12.06 on 4 Df
- Pseudo R-squared: 0.2956
- Number of iterations: 232 (BFGS) + 12 (Fisher scoring)
- # predict result of first row
- predict = predict(regression.beta, newdata = data[1,])
- outcome = 1.234 + (0.051*31.814) - (0.11*-7.746)
- outcome = 3.708
Add Comment
Please, Sign In to add comment