SHARE
TWEET
Untitled
a guest
Jan 29th, 2018
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- > sinks <- raster("rasterized.tif")
- > tpi <- raster("TPI.tif")
- > model <- glm(sinks[]~tpi[], family= binomial)
- > summary(model)
- Call:
- glm(formula = sinks[] ~ tpi[], family = binomial)
- Deviance Residuals:
- Min 1Q Median 3Q Max
- -0.5368 -0.3780 -0.3774 -0.3766 2.3877
- Coefficients:
- Estimate Std. Error z value Pr(>|z|)
- (Intercept) -2.606015 0.001022 -2551.117 <2e-16 ***
- tpi[] -0.321924 0.038967 -8.261 <2e-16 ***
- ---
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- (Dispersion parameter for binomial family taken to be 1)
- Null deviance: 7496150 on 14968071 degrees of freedom
- Residual deviance: 7496082 on 14968070 degrees of freedom
- (15480 observations deleted due to missingness)
- AIC: 7496086
- Number of Fisher Scoring iterations: 5}
- >test <- raster("tpi_test.tif")
- > predict(test, model, type="response")
- Error in p[-naind, ] <- predv :
- number of items to replace is not a multiple of replacement length
- In addition: Warning message:
- 'newdata' had 690549 rows but variables found have 14983552 rows
RAW Paste Data

