Guest User

Untitled

a guest
Dec 13th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. # Made up data
  2. x1 = c(0.051,0.049,0.046,0.042,0.042,0.041,0.038,0.037,0.043,0.031)
  3. x2 = c(0.11,0.12,0.09,0.21,0.18,0.11,0.13,0.11,0.08,0.10)
  4. y = c(0.97,0.87,0.77,0.65,0.77,0.84,0.76,0.73,0.82,0.90)
  5.  
  6. data = data.frame(x1,x2,y)
  7.  
  8. # run beta regression on data using loglog link
  9. regression.beta = betareg(y ~ x1 + x2, link = "loglog")
  10.  
  11. # summarise result:
  12. summary(regression.beta)
  13.  
  14. Call:
  15. betareg(formula = y ~ x1 + x2, link = "loglog")
  16.  
  17. Standardized weighted residuals 2:
  18. Min 1Q Median 3Q Max
  19. -1.4901 -0.8370 -0.2718 0.2740 2.6258
  20.  
  21. Coefficients (mean model with loglog link):
  22. Estimate Std. Error z value Pr(>|z|)
  23. (Intercept) 1.234 1.162 1.062 0.2882
  24. x1 31.814 26.715 1.191 0.2337
  25. x2 -7.776 3.276 -2.373 0.0176 *
  26.  
  27. Phi coefficients (precision model with identity link):
  28. Estimate Std. Error z value Pr(>|z|)
  29. (phi) 24.39 10.83 2.252 0.0243 *
  30. ---
  31. Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  32.  
  33. Type of estimator: ML (maximum likelihood)
  34. Log-likelihood: 12.06 on 4 Df
  35. Pseudo R-squared: 0.2956
  36. Number of iterations: 232 (BFGS) + 12 (Fisher scoring)
  37.  
  38. # predict result of first row
  39. predict = predict(regression.beta, newdata = data[1,])
  40.  
  41. outcome = 1.234 + (0.051*31.814) - (0.11*-7.746)
  42. outcome = 3.708
Add Comment
Please, Sign In to add comment