daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. > sinks <- raster("rasterized.tif")
  2. > tpi <- raster("TPI.tif")
  3. > model <- glm(sinks[]~tpi[], family= binomial)
  4. > summary(model)
  5.  
  6. Call:
  7. glm(formula = sinks[] ~ tpi[], family = binomial)
  8.  
  9. Deviance Residuals:
  10.     Min       1Q   Median       3Q      Max  
  11. -0.5368  -0.3780  -0.3774  -0.3766   2.3877  
  12.  
  13. Coefficients:
  14.              Estimate Std. Error   z value Pr(>|z|)    
  15. (Intercept) -2.606015   0.001022 -2551.117   <2e-16 ***
  16. tpi[]       -0.321924   0.038967    -8.261   <2e-16 ***
  17. ---
  18. Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  19.  
  20. (Dispersion parameter for binomial family taken to be 1)
  21.  
  22.     Null deviance: 7496150  on 14968071  degrees of freedom
  23. Residual deviance: 7496082  on 14968070  degrees of freedom
  24.   (15480 observations deleted due to missingness)
  25. AIC: 7496086
  26.  
  27. Number of Fisher Scoring iterations: 5}
  28.    
  29. >test <- raster("tpi_test.tif")
  30. > predict(test, model, type="response")
  31. Error in p[-naind, ] <- predv :
  32.   number of items to replace is not a multiple of replacement length
  33. In addition: Warning message:
  34. 'newdata' had 690549 rows but variables found have 14983552 rows
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top