#### Authors: Gundula Bartzke, with the help from Roel May #### Last modified: 06.02.2015 #### This script contains code used in statistical analyses and predictions for the manuscript #### G.S. Bartzke, R. May, E.J. Solberg, C.M. Rolandsen, and E. Røskaft. 2015. #### “Differential barrier and corridor effects of roads, power lines and rivers #### on moose movements”. Ecosphere. #### The R code includes the commands to run a basic ("mcb"), barrier ("mcr"), corridor ("mcor") #### and a combined ("mco") cox proportional hazard model testing for the effects of #### environmental variables, linear features (roads, power lines, rivers) #### and linear feature combinations on moose step selection in Central-Norway. #### The code to calculate QIC values ("QIC.coxph", from Mathieu Basille), #### a customized predict function for cox proportional hazard models ("prcph2"), #### the code to reproduce model predictions, graphs #### and the code for seasonal models is also provided. #### The code should be run consecutively. library("rms") moose <- read.table("//.txt", sep=",") #### This is a subset of the data used in statistical analyses for the manuscript #### G.S. Bartzke, R. May, E.J. Solberg, C.M. Rolandsen, and E. Røskaft. 2015. #### “Differential barrier and corridor effects of roads, power lines and rivers #### on moose movements”. Ecosphere. #### We provide a random subset of one third of the sets of moose steps #### used in the full analysis. Therefore, the results of this analysis are different to those in the manuscript. #### Each row in the data corresponds to one step. #### Sets of steps consist of one selected (sel=1) and five random (sel=0) steps. #### Selected steps were derived from moose GPS relocation data collected in Central-Norway during 2006-2010. #### The columns correspond to attributes assigned to steps. #### The full data may be obtained from the authors upon request. #### Please ask the Norwegian Institute for Nature Research (NINA) for consent before using this data for publication. #### Contact Erling.Solberg@nina.no and Christer.Rolandsen@nina.no. moose$forest <- relevel(moose$forest, ref="yes") moose$cr <- factor(moose$cr, levels=c("no","Rd", "Pl", "Ri", "RdRi", "PlRd", "PlRi")) moose$crf <- factor(moose$crf, levels=c("no", "Rd", "Pl", "Ri")) moose$crpa <- factor(moose$crpa, levels=c("no", "Rd", "Pl", "Ri")) moose$type3 <- factor(moose$type3, levels=c("no", "Rd", "Pl", "Ri", "RdRi", "PlRd", "PlRi")) moose$fty2 <- factor(moose$fty2, levels=c("no", "Rd", "Pl", "Ri")) moose$typa <- factor(moose$typa, levels=c("no", "Rd", "Pl", "Ri")) #### description of variables in dataframe moose #x x-coordinate at start relocation of step #x1 x-coordinate at end relocation of step #y y-coordinate at start relocation of step #y1 y-coordiante at end relocation of step #date date #dHus distance to urban settlements at the end point of steps #length step length in m #sel variable indicating if step was selected (value 1) or random (value 0) #elevdm maximum elevation difference along steps in m #forest factor for forest cover along steps, reference level: yes #elevs elevation at end points of steps in m #elevsq squared elevation at end point of steps #mind distance to closest linear feature in m #mindq squared distance to closest linear feature #dityRd dummy variable for interaction between distance and road in m #dityRi dummy variable for interaction between distance and river in m #dityqRd dummy variable for interaction between squared distance and road #dityqRi dummy variable for interaction between squared distance and river #cr factor for crossed linear feature type: road, river, power line or combinations thereof reference level: no crossing #crf factor for interaction between steps crossings of roads, power lines or rivers with steps traversing open habitats; reference level: no crossing #crpa factor for interaction between crossings of roads, power lines or rivers with the alignment of those features along contour lines; reference level: no crossing #andiRd dummy variable for steps that crossed roads and distance to closest road in m #andiPl dummy variable for steps that crossed power lines and distance to closest power line in m #andiRi dummy variable for steps that crossed rivers and distance to closest river in m #andiRdRi dummy variable for steps that crossed roads and rivers and distance to closest road or river in m #andiPlRd dummy variable for steps that crossed power lines and roads and distance to closest power line or road in m #andiPlRi dummy variable for steps that crossed power lines and rivers and distance to closest power line or river in m #type3 linear feature type that moose moved along; reference level: no movement along linear feature #fty2 factor for interaction between movements along roads, power lines or rivers with steps traversing open habitats; reference level: no movement along linear feature #typa factor for interaction between movements along roads, power lines or rivers with the alignment of each feature along contour lines; reference level: no movement along linear features #andiRd2 dummy variable for steps along roads and distance to closest road in m #andiPl2 dummy variable for steps along power lines and distance to closest power line in m #andiRi2 dummy variable for steps along rivers and distance to closest river in m #andiRdRi2 dummy variable for steps along road/river combinations and distance to closest road or river in m #andiPlRd2 dummy variable for steps along road/power line combinations and distance to closest road or power line in m #andiPlRi2 dummy variable for steps along power line/river combinations and distance to closest power line or river in m #set sets of steps, where one set consists of 1 selected and 5 random steps #clus cluster, where each indiviudal is one cluster #### script to calculate QIC values QIC.coxph <- function(mod, details = FALSE) ### Mathieu Basille, basille@ase-research.org ### Last modified: 2010-11-10 ### With the help of Thierry Duchesne and Marc Mazerolle { trace <- sum(diag(solve(mod$naive.var) %*% mod$var)) quasi <- mod$loglik[2] if (details) return(data.frame(QICR = -2 * quasi + 2 * trace, QICI = -2 * quasi + 2 * length(mod$coefficients), QuasiLL = quasi, K = length(mod$coefficients), Trace = trace)) else return(-2 * quasi + 2 * trace) } #### customized predict function from the package "rms" #### to derive non-centered linear predictors from #### cox proportional hazard models Getlim <- function (at, allow.null = FALSE, need.all = TRUE) { nam <- at$name[at$assume != "interaction"] limits <- at$limits values <- at$values XDATADIST <- .Options$datadist X <- lims <- vals <- NULL if (!is.null(XDATADIST) && exists(XDATADIST)) { X <- eval(as.name(XDATADIST)) lims <- X$limits if (is.null(lims)) stop(paste("options(datadist=", XDATADIST, ") not created with datadist")) vals <- X$values } if ((length(X) + length(limits)) == 0) { if (allow.null) { lims <- list() for (nn in nam) lims[[nn]] <- rep(NA, 7) lims <- structure(lims, class = "data.frame", row.names = c("Low:effect", "Adjust to", "High:effect", "Low:prediction", "High:prediction", "Low", "High")) return(list(limits = lims, values = values)) } stop("no datadist in effect now or during model fit") } na <- if (length(limits)) sapply(limits, function(x) all(is.na(x))) else rep(TRUE, length(nam)) if (length(lims) && any(na)) for (n in nam[na]) { z <- limits[[n]] u <- if (match(n, names(lims), 0) > 0) lims[[n]] else NULL if (is.null(u)) { if (need.all) stop(paste("variable", n, "does not have limits defined in fit or with datadist")) else limits[[n]] <- rep(NA, 7) } else limits[[n]] <- u } limits <- structure(limits, class = "data.frame", row.names = c("Low:effect", "Adjust to", "High:effect", "Low:prediction", "High:prediction", "Low", "High")) if (length(vals)) values <- c(values, vals[match(names(vals), nam, 0) > 0 & match(names(vals), names(values), 0) == 0]) list(limits = limits, values = values) } Getlimi <- function (name, Limval, need.all = TRUE) { lim <- if (match(name, names(Limval$limits), 0) > 0) Limval$limits[[name]] else NULL if (is.null(Limval) || is.null(lim) || all(is.na(lim))) { if (need.all) stop(paste("no limits defined by datadist for variable", name)) return(rep(NA, 7)) } lim } predictrms2 <- function (fit, newdata = NULL, type = c("lp", "x", "data.frame", "terms", "cterms", "ccterms", "adjto", "adjto.data.frame", "model.frame"), se.fit = FALSE, conf.int = FALSE, conf.type = c("mean", "individual", "simultaneous"), kint = NULL, na.action = na.keep, expand.na = TRUE, center.terms = type == "terms", ref.zero = FALSE, ...) { type <- match.arg(type) conf.type <- match.arg(conf.type) if (conf.type == "simultaneous") { require(multcomp) if (missing(newdata) || !length(newdata)) stop("newdata must be given if conf.type=\"simultaneous\"") } at <- fit$Design assume <- at$assume.code Limval <- Getlim(at, allow.null = TRUE, need.all = FALSE) Values <- Limval$values non.ia <- assume != 9L non.strat <- assume != 8L f <- sum(non.ia) nstrata <- sum(assume == 8L) somex <- any(non.strat) rnam <- NULL cox <- inherits(fit, "cph") naa <- fit$na.action if (!expand.na) naresid <- function(a, b) b parms <- at$parms name <- at$name coeff <- fit$coefficients nrp <- num.intercepts(fit) nrpcoef <- num.intercepts(fit, "coef") if (!length(kint)) kint <- fit$interceptRef int.pres <- nrp > 0L assign <- fit$assign nama <- names(assign)[1L] asso <- 1 * (nama == "Intercept" | nama == "(Intercept)") Center <- 0 oldopts <- options(contrasts = c(factor = "contr.treatment", ordered = "contr.poly"), Design.attr = at) on.exit({ options(contrasts = oldopts$contrasts) options(Design.attr = NULL) }) Terms <- delete.response(terms(formula(fit), specials = "strat")) off <- attr(Terms, "offset") if (length(off)) Terms <- drop.terms(Terms, off) attr(Terms, "response") <- 0L attr(Terms, "intercept") <- 1L stra <- attr(Terms, "specials")$strat Terms.ns <- if (length(stra)) Terms[-stra] else Terms if (conf.int) { vconstant <- 0 if (conf.type == "individual") { vconstant <- fit$stats["Sigma"]^2 if (is.na(vconstant)) stop("conf.type=\"individual\" requires that fit be from ols") } zcrit <- if (length(idf <- fit$df.residual)) qt((1 + conf.int)/2, idf) else qnorm((1 + conf.int)/2) } Adjto <- function(type) { adjto <- list() ii <- 0L for (i in (1L:length(assume))[non.ia]) { ii <- ii + 1L xi <- Getlimi(name[i], Limval, need.all = TRUE)[2L] if (assume[i] %in% c(5L, 8L)) xi <- factor(xi, parms[[name[i]]]) else if (assume[i] == 7L) xi <- scored(xi, name = name[i]) else if (assume[i] == 10L) xi <- matrix(parms[[name[i]]], nrow = 1) adjto[[ii]] <- xi } names(adjto) <- name[non.ia] attr(adjto, "row.names") <- "1" class(adjto) <- "data.frame" if (type == "adjto.data.frame") return(adjto) adjto <- model.frame(Terms, adjto) adjto <- if (int.pres) model.matrix(Terms.ns, adjto)[, -1, drop = FALSE] else model.matrix(Terms.ns, adjto) if (type == "adjto") { k <- (nrpcoef + 1L):length(coeff) nck <- names(coeff)[k] if (is.matrix(adjto)) dimnames(adjto) <- list(dimnames(adjto)[[1L]], nck) else names(adjto) <- nck } adjto } adjto <- NULL if (type != "adjto" & type != "adjto.data.frame") { X <- NULL if (missing(newdata) || !length(newdata)) { flp <- fit$linear.predictors if (type == "lp" && length(flp)) { LP <- naresid(naa, flp) if (int.pres) { lpkint <- attr(flp, "intercepts") if (!length(lpkint)) lpkint <- 1L if (length(kint) && kint != lpkint) { LP <- LP - coeff[lpkint] + coeff[kint] } } if (length(stra <- fit$Strata)) attr(LP, "strata") <- naresid(naa, stra) if (!se.fit && !conf.int) return(LP) else if (length(fit$se.fit)) { if (nrp > 1L) warning("se.fit is retrieved from the fit but it corresponded to kint") retlist <- list(linear.predictors = LP) if (se.fit) retlist$se.fit <- naresid(naa, fit$se.fit) if (conf.int) { plminus <- zcrit * sqrt(retlist$se.fit^2 + vconstant) retlist$lower <- LP - plminus retlist$upper <- LP + plminus } return(retlist) } } else if (type == "x") return(structure(naresid(naa, fit$x), strata = if (length(stra <- fit$Strata)) naresid(naa, stra) else NULL)) X <- fit[["x"]] rnam <- dimnames(X)[[1]] if (!length(X)) stop("newdata not given and fit did not store x") } if (!length(X)) { if (!is.data.frame(newdata)) { if (is.list(newdata)) { loc <- if (!length(names(newdata))) 1L:f else name[assume != 9L] new <- matrix(double(1L), nrow = length(newdata[[1L]]), ncol = length(newdata)) for (j in 1L:ncol(new)) new[, j] <- newdata[[loc[j]]] newdata <- new } if (!is.matrix(newdata)) newdata <- matrix(newdata, ncol = f) if (ncol(newdata) != f) stop("# columns in newdata not= # factors in design") X <- list() k <- 0L ii <- 0L for (i in (1L:length(assume))[non.ia]) { ii <- ii + 1L xi <- newdata[, ii] as <- assume[i] allna <- all(is.na(xi)) if (as == 5L | as == 8L) { xi <- as.integer(xi) levels(xi) <- parms[[name[i]]] class(xi) <- "factor" } else if (as == 10L) { if (i == 1) ifact <- 1L else ifact <- 1L + sum(assume[1L:(i - 1L)] != 8L) ncols <- length(assign[[ifact + asso]]) if (allna) { xi <- matrix(double(1L), nrow = length(xi), ncol = ncols) for (j in 1L:ncol(xi)) xi[, j] <- parms[[name[i]]][j] } else xi <- matrix(xi, nrow = length(xi), ncol = ncols) } k <- k + 1L X[[k]] <- xi } names(X) <- name[non.ia] attr(X, "row.names") <- as.character(1L:nrow(newdata)) class(X) <- "data.frame" newdata <- X if (type == "data.frame") return(newdata) } else { nm <- names(newdata) for (i in 1L:ncol(newdata)) { j <- match(nm[i], name) if (!is.na(j)) { asj <- assume[j] w <- newdata[, i] V <- NULL if (asj %in% c(5L, 7L, 8L) | (name[j] %in% names(Values) && length(V <- Values[[name[j]]]) && is.character(V))) { if (length(Pa <- parms[[name[j]]])) V <- Pa newdata[, i] <- factor(w, V) ww <- is.na(newdata[, i]) & !is.na(unclass(w)) if (any(ww)) { cat("Error in predictrms: Values in", names(newdata)[i], "not in", V, ":\n") print(as.character(w[ww]), quote = FALSE) stop() } } } } } X <- model.frame(Terms, newdata, na.action = na.action, ...) if (type == "model.frame") return(X) naa <- attr(X, "na.action") rnam <- row.names(X) strata <- list() nst <- 0 ii <- 0 for (i in 1L:ncol(X)) { ii <- ii + 1L xi <- X[[i]] asi <- attr(xi, "assume.code") as <- assume[ii] if (!length(asi) && as == 7L) { attr(X[, i], "contrasts") <- attr(scored(xi, name = name[ii]), "contrasts") if (length(xi) == 1L) warning("a bug in model.matrix can produce incorrect results\nwhen only one observation is being predicted for an ordered variable") } if (as == 8L) { nst <- nst + 1L ste <- paste(name[ii], parms[[name[ii]]], sep = "=") strata[[nst]] <- factor(ste[X[, i]], ste) } } X <- if (!somex) NULL else model.matrix(Terms.ns, X)[, -1L, drop = FALSE] if (nstrata > 0L) { names(strata) <- paste("S", 1L:nstrata, sep = "") strata <- interaction(as.data.frame(strata), drop = FALSE) } } else strata <- attr(X, "strata") } cov <- vcov(fit, regcoef.only = TRUE, intercepts = kint) covnoint <- if (nrp == 0) cov else vcov(fit, regcoef.only = TRUE, intercepts = "none") if (type %in% c("adjto.data.frame", "adjto")) return(Adjto(type)) if (type == "x") return(structure(naresid(naa, X), strata = if (nstrata > 0) naresid(naa, strata) else NULL, na.action = if (expand.na) NULL else naa)) if (type == "lp") { if (somex) { xb <- matxv(X, coeff, kint = kint) - Center names(xb) <- rnam } else { xb <- numeric(0) if (nstrata > 0) attr(xb, "strata") <- naresid(naa, strata) return(structure(if (se.fit) list(linear.predictors = xb, se.fit = rep(NA, length(xb))) else xb, na.action = if (expand.na) NULL else naa)) } xb <- naresid(naa, xb) if (nstrata > 0) attr(xb, "strata") <- naresid(naa, strata) ycenter <- if (ref.zero && somex) { if (!length(adjto)) adjto <- Adjto(type) matxv(adjto, coeff, kint = kint) - Center } else 0 if (ref.zero || ((se.fit || conf.int) && somex)) { dx <- dim(X) n <- dx[1L] p <- dx[2L] if (cox) X <- X - rep(fit$means, rep.int(n, p)) else if (ref.zero) { if (!length(adjto)) adjto <- Adjto(type) X <- X - rep(adjto, rep.int(n, p)) } se <- drop(if (ref.zero || nrp == 0L) sqrt(((X %*% covnoint) * X) %*% rep(1L, ncol(X))) else { Xx <- cbind(Intercept = 1, X) sqrt(((Xx %*% cov) * Xx) %*% rep(1L, ncol(Xx))) }) names(se) <- rnam sef <- naresid(naa, se) ww <- if (conf.int || se.fit) { if (se.fit) list(linear.predictors = xb - ycenter, se.fit = sef) else list(linear.predictors = xb - ycenter) } else xb - ycenter retlist <- structure(ww, na.action = if (expand.na) NULL else naa) if (conf.int) { if (conf.type == "simultaneous") { num.intercepts.not.in.X <- length(coeff) - ncol(X) u <- confint(glht(fit, if (num.intercepts.not.in.X == 0L) X else Xx, df = if (length(idf)) idf else 0L), level = conf.int)$confint retlist$lower <- u[, "lwr"] retlist$upper <- u[, "upr"] } else { plminus <- zcrit * sqrt(sef^2 + vconstant) retlist$lower <- xb - plminus - ycenter retlist$upper <- xb + plminus - ycenter } } return(retlist) } else return(structure(xb - ycenter, na.action = if (expand.na) NULL else naa)) } if (type %in% c("terms", "cterms", "ccterms")) { if (!somex) stop("type=\"terms\" may not be given unless covariables present") usevar <- if (type == "terms") non.strat else rep(TRUE, length(assume)) fitted <- array(0, c(nrow(X), sum(usevar)), list(rnam, name[usevar])) if (se.fit) se <- fitted if (center.terms) { if (!length(adjto)) adjto <- Adjto(type) if (ncol(adjto) != ncol(X)) { if (dimnames(adjto)[[2L]][1L] %in% c("Intercept", "(Intercept)") && dimnames(X)[[2L]][1L] %nin% c("Intercept", "(Intercept)")) adjto <- adjto[, -1L, drop = FALSE] if (ncol(adjto) != ncol(X)) stop("program logic error") } X <- sweep(X, 2L, adjto) } j <- 0L for (i in (1L:length(assume))[usevar]) { j <- j + 1L if (assume[i] != 8L) { k <- assign[[j + asso]] num.intercepts.not.in.X <- length(coeff) - ncol(X) ko <- k - num.intercepts.not.in.X fitted[, j] <- matxv(X[, ko, drop = FALSE], coeff[k]) if (se.fit) se[, j] <- (((X[, ko, drop = FALSE] %*% cov[k, k, drop = FALSE]) * X[, ko, drop = FALSE]) %*% rep(1, length(ko)))^0.5 } } if (type == "cterms") { w <- fitted[, non.ia, drop = FALSE] for (i in 1L:f) { ia <- interactions.containing(at, i) if (length(ia)) w[, i] <- rowSums(fitted[, c(i, ia), drop = FALSE]) } fitted <- w } if (type == "ccterms") { z <- combineRelatedPredictors(at) f <- length(z$names) w <- matrix(NA, ncol = f, nrow = nrow(fitted)) colnames(w) <- sapply(z$names, paste, collapse = ", ") for (i in 1L:f) w[, i] <- rowSums(fitted[, z$namesia[[i]], drop = FALSE]) fitted <- w } fitted <- structure(naresid(naa, fitted), strata = if (nstrata == 0) NULL else naresid(naa, strata)) if (se.fit) { return(structure(list(fitted = fitted, se.fit = naresid(naa, se)), na.action = if (expand.na) NULL else naa)) } else return(structure(fitted, na.action = if (expand.na) NULL else naa)) } } prcph2 <- function (object, newdata = NULL, type = c("lp", "x", "data.frame", "terms", "cterms", "ccterms", "adjto", "adjto.data.frame", "model.frame"), se.fit = FALSE, conf.int = FALSE, conf.type = c("mean", "individual", "simultaneous"), kint = 1, na.action = na.keep, expand.na = TRUE, center.terms = type == "terms", ...) { type <- match.arg(type) predictrms2(object, newdata, type, se.fit, conf.int, conf.type, kint, na.action, expand.na, center.terms, ...) } d <- datadist(moose) options(datadist="d") gc() #### basic model analyzing moose step selection in response to #### forest cover, elevation, topology and distances to different linear features mcb <- cph(Surv(rep(1, nrow(moose)), sel) ~ length+ forest+ elevdm+ elevs+ elevsq+ mind+ mindq+ dityRd+ dityRi+ dityqRd+ dityqRi+ strat(set)+ cluster(clus), data=moose, method = "exact", tol=1e-16, x=TRUE) QIC.coxph(mcb) rm("mcb") gc() #### barrier model analyzing moose step selection #### including the effects in the basic model #### as well as barrier effects of different linear features #### and linear feature combinations mcr <- cph(Surv(rep(1, nrow(moose)), sel) ~ length+ elevdm+ forest+ elevs+ elevsq+ mind+ mindq+ dityRd+ dityRi+ dityqRd+ dityqRi+ cr+ crf+ crpa+ andiRd+ andiPl+ andiRi+ andiRdRi+ andiPlRd+ andiPlRi+ strat(set)+ cluster(clus), data=moose, method = "exact", tol=1e-16, x=TRUE) QIC.coxph(mcr) rm("mcr") gc() #### corridor model analyzing moose step selection #### including the effects in the basic model #### as well as barrier effects of different linear features #### and linear feature combinations mcor <- cph(Surv(rep(1, nrow(moose)), sel) ~ elevdm+ forest+ elevs+ elevsq+ mind+ mindq+ dityRd+ dityRi+ dityqRd+ dityqRi+ type3+ fty2+ typa+ andiRd2+ andiPl2+ andiRi2+ andiRdRi2+ andiPlRd2+ andiPlRi2+ strat(set)+ cluster(clus), data=moose, method = "exact", tol=1e-16, x=TRUE) QIC.coxph(mcor) rm("mcor") gc() #### combined model analyzing moose step selection #### including the effects of the basic model #### as well es barrier and corridor effects of different linear features #### and linear feature combinations mco <- cph(Surv(rep(1, nrow(moose)), sel) ~ length+ elevdm+ forest+ elevs+ elevsq+ mind+ mindq+ dityRd+ dityRi+ dityqRd+ dityqRi+ cr+ crf+ crpa+ andiRd+ andiPl+ andiRi+ andiRdRi+ andiPlRd+ andiPlRi+ type3+ fty2+ typa+ andiRd2+ andiPl2+ andiRi2+ andiRdRi2+ andiPlRd2+ andiPlRi2+ strat(set)+ cluster(clus), data=moose, method = "exact", tol=1e-16, x=TRUE) QIC.coxph(mco) # rm("mco") gc() var <- list() for(i in 1:47){ var[[i]] <- mco$var[i,i] } # coefficients, robust standard errors, wald chi-square statistics, p-values coeff <- coefficients(mco) S.E. <- sqrt(unlist(var)) waldchisq <- (coeff/S.E.)^2 p <- pchisq((coeff/S.E.)^2, df=1, lower.tail = F) data.frame(coeff=format(coeff, digits=2), S.E=format(S.E., scientific=T, digits=2), waldchisq=round(waldchisq, digits=1),p=round(p, digits=3)) #### predictions from most parsimoneous combined model ########################################################################## ## predictions for movements at the edge (25m distance) of linear features ########################################################################## #### these variables are held at their mean values for all predictions le <- 100 # assume step length of 100 meters ed <- mean(moose$elevdm[moose$sel==1]) # mean elevation difference along steps dE <- mean(moose$elevs[moose$sel==1]) # mean elevation at endpoint of steps dEq <- dE^2 # squared mean elevation at endpoint of steps setn <- moose$set[1] # the set of steps is irrelevant for the predictions #### derive linear predictor for steps crossing roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # road crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # road crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement through forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along road when not aligned along contour line levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di ^ # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movement steps away from roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors # probability for crossing roads in forest, when not aligned along contour lines crRdpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpef # probability for moving along roads in forest, when not aligned along contour lines moRdpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpef # probability for moving away from roads in forest, when not aligned along contour lines awRdpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpef #### derive linear predictor for steps crossing roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # road crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[2] # road crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along road # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for steps along roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along road in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[2] # movement along road when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads in forests, when aligned along contour lines crRdpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpaf #### probability for moving along roads in forests, when aligned along contour lines moRdpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpaf #### probability for moving away from roads in forests, when aligned along contour lines awRdpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpaf #### derive linear predictor for crossing roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[2] # road crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # road crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[2] # movement along road in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along road when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads in open habitats #### roads not aligned along contour lines crRdpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpeo #### probability for moving along roads in open habitats #### roads not aligned along contour lines moRdpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpeo #### probability for moving away from roads in open habitats #### roads not aligned along contour lines awRdpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpeo #### derive linear predictor for crossing roads in open habitats #### roads aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[2] # road crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[2] # road crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiRin <- 0 andiPln <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along roads in open habitats #### road aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[2] # movement along road in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[2] # movement along road when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from road in open habitats #### road aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing road in open habitats #### road aligned along countour lines crRdpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpao #### probability for moving along road in open habitats #### road aligned along countour lines moRdpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpao #### probability for moving away from roads in open habitats #### road aligned along contour lines awRdpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpao #### derive linear predictor for crossing power lines in forest #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqPln <- dityPln^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # power line crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # power line crossed when not aligned along contour lines levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 25 # power line crossed at 25m distance andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power lines in forests #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along power line in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along power line when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 25 # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco, newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power lines in forests #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco, newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in forest #### power lines not aligned along contour lines crPlpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpef #### probability for moving along power lines in forest #### power lines not aligned along contour lines moPlpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpef #### probability of moving away from power lines in forest #### power lines not aligned along contour lines awPlpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpef #### derive linear predictor for crossing power lines in forest #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # power line crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[3] # power line crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl= andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear preditor for moving along power lines in forest #### power lines are aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # in forest # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiPln <- 0 # no crossing of linear features andiPlRdn <- 0 andiPlRin <- 0 andiRdn <- 0 andiRdRin <- 0 andiRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along power line in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[3] # movement along power line when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 25 # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power lines in forest #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in forest #### power line aligned along contour line crPlpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpaf #### probability for moving along power line in forest #### power line aligned along contour line moPlpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpaf #### probability for moving away from power line in forest #### power line aligned along contour line awPlpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpaf #### derive linear predictor for crossing power lines in open habitats #### power lines not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$crf)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[3] # power line crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # power line crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power line in open habitats #### power line not aligned along contour line forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to linear closest feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[3] # movement along power line in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along power line when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power line in open habiats #### power line not aligned along contour line forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in open habitats #### power lines not aligned along contour lines crPlpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpeo #### probability for moving along power lines in open habitats #### power lines not aligned along contour lines moPlpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpeo #### probability for moving away from power lines in open habitats #### power lines not aligned along contour lines awPlpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpeo #### derive linear predictor for crossing power lines in open habitats #### power lines aligend along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[3] # power line crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[3] # power line crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power lines in open habitats #### power lines aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[3] # movement along power line in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[3] # movement along power line when aligned along contour line levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power line in open habitats #### power line aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in open habitats #### power lines aligned along contour lines crPlpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpao #### probability for moving along power lines in open habitats #### power lines aligned along contour lines moPlpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpao #### probability for moving away from power lines in open habitats #### power lines aligned along contour lines awPlpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpao #### derive linear predictor for crossing rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # river crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # river crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along river in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along river when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPl2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in forests #### river not aligned along contour lines crRipef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipef #### probability for moving along rivers in forests #### river not aligned along contour lines moRipef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipef #### probability for moving away from rivers in forests #### river not aligned along contour lines awRipef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipef #### derive linear predictor for crossing rivers in forest #### rivers aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # river crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[4] # river crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in forest #### river aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along river in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[4] # movement along river when aligned along contour line levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from a rivers in forest #### river aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance from closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance from closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 # no crossing of linear features andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in forests #### rivers aligned along contour lines crRipaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipaf #### probability for moving along rivers in forests #### rivers aligned along contour lines moRipaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipaf #### probability for moving away from rivers in forests #### rivers aligned along contour lines awRipaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipaf #### derive linear predictor for crossing rivers in open habitats #### river not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[4] # river crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # river crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers #### rivers not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[4] # movement along river in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along river when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers #### river not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in open habitats #### rivers not aligned along contour lines crRipeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipeo #### probability for moving along rivers in open habitats #### rivers not aligned along contour lines moRipeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipeo #### probability for moving away from rivers in open habitats #### rivers not aligned along contour lines awRipeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipeo #### derive linear predictor for crossing rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[4] # river crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[4] # river crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25 distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[4] # movement along river in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[4] # movement along river when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in open habitats #### river aligned along contour lines crRipao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipao #### probability for moving along rivers in open habitats #### river aligned along contour lines moRipao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipao #### probability for moving away from rivers in open habitats #### river aligned along contour lines awRipao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipao #### linear feature combinations #### derive linear predictor for crossing roads and rivers forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[5] # road and river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # interaction with forest cover not specified levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # interaction with alignment along contour lines not specified levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- 0 andiRdRin <- di # 25m distance from closest road when crossing andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[5] # movement along road/river combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- di # movement along road/river combinations at 25m distance andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors ## derive linear predictor for moving away from road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing road/river combinations crRdRi <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdRi #### probability for moving along road/river combinations moRdRi <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdRi #### probability for moving away from road/river combinations awRdRi <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdRi #### derive linear predictor for crosssing roads and power lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[6] # road and power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # interaction with forest cover not specified levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # interaction with alignment along contour lines not specified levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- di # road and power line crossed at 25m distance andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 typan <- levels(moose$typa)[1] crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[6] # movement along road/power line combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- di # movement along road/power line combinations at 25m distance andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors ## moving away from road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads and power lines crRdPl <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdPl #### probability for moving along road/power line combinations moRdPl <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdPl #### probability for moving away from road/power line combinations awRdPl <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdPl #### derive linear predictor for crossing power lines and rivers forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[7] # power line and river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # interaction with forest cover not specified [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # interaction with alignment along contour lines not specified levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 25 # power line and river crossed at 25m distance type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[7] # movement along power line/river combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- di # movement along power line/river combinations at 25m distance lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines and rivers crPlRi <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlRi #### probability for moving along power line/river combinations moPlRi <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlRi #### probability for moving away from power line/river combinations awPlRi <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlRi ######################################################################## ## predictions for changes in movements with distance to linear features ######################################################################## #### derive linear predictor for movements towards roads in forests without crossing roads #### roads not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in forests without crossing roads #### roads not aligned along contour lines setn <- moose$set[1] forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 # no option to cross linear features andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[2] # movements along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movements along road in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movements along road when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # distances to closest road for movements along roads andiRi2n <- 0 andiPl2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from roads in forest without the option to cross roads #### roads not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for moving towards roads in forests without the option to cross roads #### roads not aligned along contour lines crRdpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpef[1] #### probability for moving along roads in forests without the option to cross roads #### roads not aligned along contour lines moRdpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpef[1] #### probability for moving away from roads in forests without the option to cross roads #### roads not aligned along contour lines awRdpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpef[1] #### derive linear predictor for moving towards roads in forests without the option to cross roads #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in forests without the option to cross roads #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[2] # movements along roads levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movements along roads in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[2] # movements along roads when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # distances for movements along roads andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away roads in forests without the option to cross roads #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for moving towards roads in forests without the option to cross roads #### roads aligned along contour lines crRdpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpaf[1] #### probability for moving along roads in forests without the option to cross roads #### roads aligned along contour lines moRdpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpaf[1] #### probability for moving away from roads in forests without the option to cross roads #### roads aligned along contour lines awRdpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpaf[1] #### derive linear predictor for moving towards roads in open habitats without the option to cross roads #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in open habitats without the option to cross roads #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[2] # movements along roads levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[2] # movements along roads in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movements along roads when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # distances for movements along roads andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from roads in open habitats without the option to cross roads #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for moving towards roads in open habitats without the option to cross roads #### roads not aligned along contour lines crRdpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpeo[1] #### probability for along towards roads in open habitats without the option to cross roads #### roads not aligned along contour lines moRdpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpeo[1] #### probability for moving away from roads in open habitats without the option to cross roads #### roads not aligned along contour lines awRdpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpeo[1] #### derive linear predictor for moving towards roads in open habitats without the option to cross roads #### roads aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in open habitats without the option to cross roads #### roads aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10) # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # distance to closest linear road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[2] # movements along roads levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[2] # movements along roads in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[2] # movements along roads when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # distances for movements along road andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from roads in open habitats without the option to cross roads #### roads aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to roads dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to roads dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards roads in open habitats without the option to cross roads #### roads aligned along contour lines crRdpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpao[1] #### probability for movements along roads in open habitats without the option to cross roads #### roads aligned along contour lines moRdpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpao[1] #### probability for movements away from roads in open habitats without the option to cross roads #### roads aligned along contour lines awRdpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpao[1] #### derive linear predictor for movements towards power lines in forests without the option to cross power lines #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along power lines in forests without the option to cross power lines #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[3] # movements along power lines levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movements along power lines in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movements along power lines when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # distances for movements along power lines andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, forest=forest, elevdm=ed, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd= dityRdn, dityRi= dityRin, dityqRd= dityqRdn, dityqRi= dityqRin, type3=type3n, fty2 = fty2n, andiPl2=andiPl2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n, andiRd2=andiRd2n, andiRdRi2=andiRdRi2n, andiRi2=andiRi2n, typa=typan, cr=crn, crf=crfn, andiPl=andiPln, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, andiRd=andiRdn, andiRdRi=andiRdRin, andiRi=andiRin, crpa=crpan ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power lines in forests without the option to cross power lines #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards power lines in forests without the option to cross power lines #### power lines not aligned along contour lines crPlpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpef[1] #### probability for movements along power lines in forests without the option to cross power lines #### power lines not aligned along contour lines moPlpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpef[1] #### probability for movements away from power lines in forests without the option to cross power lines #### power lines not aligned along contour lines awPlpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpef[1] #### derive linear predictor for movements towards power lines in forests without the option to cross power lines #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear features diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along power lines in forests without the option to cross power lines #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movements along power lines levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movements along power lines in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[3] # movements along power lines when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # distances for movements along power lines andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power lines in forests without the option to cross power lines #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards power lines in forests without the option to cross power lines #### power lines aligned along contour lines crPlpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpaf[1] #### probability for movements along power lines in forests without the option to cross power lines #### power lines aligned along contour lines moPlpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpaf[1] #### probability for movements away from power lines in forests without the option to cross power lines #### power lines aligned along contour lines awPlpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpaf[1] #### derive linear predictor for movements towards power lines in open habitats without the option to cross power lines #### power lines not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along power lines in open habitats without the option to cross power lines #### power lines not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movements along power lines levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[3] # movements along power lines in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movements along power lines when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # distances for movements along power lines andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power lines in open habitats without the option to cross power lines #### power lines not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards power lines in open habitats without the option to cross power lines #### power lines not aligned along contour lines crPlpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpeo[1] #### probability for movements along power lines in open habitats without the option to cross power lines #### power lines not aligned along contour lines moPlpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpeo[1] #### probability for movements away from power lines in open habitats without the option to cross power lines #### power lines not aligned along contour lines awPlpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpeo[1] #### derive linear predictor for movements towards power lines in open habitats without the option to cross power lines #### power lines aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along power lines in open habitats without the option to cross power lines #### power lines aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movements along power lines levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[3] # movements along power lines in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[3] # movements along power lines when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # distances for movements along power lines andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power lines in open habitats without the option to cross power lines #### power lines aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movements along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movements along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movements along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movements along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards power lines in open habitats without the option to cross power lines #### power lines aligned along contour lines crPlpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpao[1] #### probability for movements along power lines in open habitats without the option to cross power lines #### power lines aligned along contour lines moPlpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpao[1] #### probability for movements away from power lines in open habitats without the option to cross power lines #### power lines aligned along contour lines awPlpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpao[1] #### derive linear predictor for movements towards rivers in forests without the option to cross rivers #### rivers not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along rivers in forests without the option to cross rivers #### rivers not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movements along rivers levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movements along rivers in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movements along rivers when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # distances for movements along rivers andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from rivers in forests without the option to cross rivers #### rivers not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards from rivers in forests without the option to cross rivers #### rivers not aligned along contour lines crRipef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipef[1] #### probability for movements along rivers in forests without the option to cross rivers #### rivers not aligned along contour lines moRipef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipef[1] #### probability for movements away from rivers in forests without the option to cross rivers #### rivers not aligned along contour lines awRipef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipef[1] #### derive linear predictor for movements towards rivers in forests without the option to cross rivers #### rivers aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along rivers in forests without the option to cross rivers #### rivers aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movements along rivers levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movements along rivers in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[4] # movements along rivers when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # distances for movements along rivers andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from rivers in forests without the option to cross rivers #### rivers aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards rivers in forests without the option to cross rivers #### rivers aligned along contour lines crRipaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipaf[1] #### probability for movements along rivers in forests without the option to cross rivers #### rivers aligned along contour lines moRipaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipaf[1] #### probability for movements away from rivers in forests without the option to cross rivers #### rivers aligned along contour lines awRipaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipaf[1] #### derive linear predictor for movements towards rivers in open habitats without the option to cross rivers #### rivers not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along rivers in open habitats without the option to cross rivers #### rivers not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movements along rivers levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[4] # movements along rivers in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movements along rivers when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # distances for movements along river andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from rivers in open habitats without the option to cross rivers #### rivers not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards rivers in open habitats without the option to cross rivers #### rivers not aligned along contour lines crRipeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipeo[1] #### probability for movements along rivers in open habitats without the option to cross rivers #### rivers not aligned along contour lines moRipeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipeo[1] #### probability for movements away from rivers in open habitats without the option to cross rivers #### rivers not aligned along contour lines awRipeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipeo[1] #### derive linear predictor for movements towards rivers in open habitats without the option to cross rivers #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)-50 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along rivers in open habitats without the option to cross rivers #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[4] # movement along river in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[4] # movement along river when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # distances for movements along rivers andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from rivers in open habitats without the option to cross rivers #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- di # distances to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distances to closest river crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movements along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movements along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movements along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movements along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards rivers in open habitats without the option to cross rivers #### rivers aligned along contour lines crRipao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipao[1] #### probability for movements along rivers in open habitats without the option to cross rivers #### rivers aligned along contour lines moRipao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipao[1] #### probability for movements away from rivers in open habitats without the option to cross rivers #### rivers aligned along contour lines awRipao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipao[1] #### make graph with predictions (Fig.3) tiff(2000,2500,filename = "//fig3.tiff", res = 450, compression ="lzw", pointsize="8") close.screen(1:100) par(mar=c(0,0,0,0)) split.screen(c(1,3)) close.screen() split.screen(c(4,1), screen = 1) split.screen(c(4,1), screen = 2) split.screen(c(4,1), screen = 3) par(mar=c(0,0,0,0), omi=c(0.82,0.89,0.18,0.03), bg="white") ‘c(bottom, left, top, right)’ # c(bottom, left, top, right)’ screen(n=4) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRdpef, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2) lines(seq(100, 1950, 10), awRdpef, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRdpef, type="l", lwd=1.5, lty=2) abline(h=0.33) legend("topright", legend=c( "A"), bg="white", cex=1.3, box.col="black",bty="n") axis(side=2, at=seq(0.25,0.40,0.05), labels=c(NA, "0.30", "0.35", "0.40"), las=1, cex.axis=1, hadj=0.8) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) mtext(side=2, text="Not anlong", line=3.5, adj=0.5, cex=1) mtext(side=2, text="contour line", line=2.6, adj=0.5, cex=1) mtext(side=2, text="Forest", line=4.6, adj=-0.15, cex=1.1) mtext(side=2, text="Step selection probability", line=5.5, adj=5.3, cex=1.2) mtext(side=3, text="Road", line=0.2, adj=0.5, cex=1.1) screen(n=5) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRdpaf, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2, xaxt="n") legend("topright", legend=c( "B"), bg="white", cex=1.3, box.col="black",bty="n") lines(seq(100, 1950, 10), awRdpaf, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRdpaf, type="l", lwd=1.5, lty=2) mtext(side=2, text="Along", line=3.5, adj=0.5, cex=1) mtext(side=2, text="contour line", line=2.6, adj=0.5, cex=1) axis(side=2, at=seq(0.25,0.40,0.05), labels=c(NA, "0.30", "0.35", "0.40"), cex.axis=1, las=1, cex.axis=1, hadj=0.8) abline(h=0.33) abline(h=0.245, lwd=2) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) screen(n=6) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRdpeo, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2, xaxt="n") lines(seq(100, 1950, 10), awRdpeo, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRdpeo, type="l", lwd=1.5, lty=2) abline(h=0.33) legend("topright", legend="C", bg="white", cex=1.3, box.col="black",bty="n") abline(h=0.405, lwd=4) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) axis(side=2, at=seq(0.25,0.40,0.05), labels=c(NA, "0.30", "0.35", "0.40"), cex.axis=1, las=1, cex.axis=1, hadj=0.8) mtext(side=2, text="Not along", line=3.5, adj=0.5, cex=1) mtext(side=2, text="contour line", line=2.6, adj=0.5, cex=1) mtext(side=2, text="Open", line=4.6, adj=-0.15, cex=1.1) screen(n=7) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRdpao, type="l", ylim=c(0.25,0.4), las=1, yaxt="n", lwd=2, cex.axis=1, padj=-0.8) legend("topright", legend="D", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) lines(seq(100, 1950, 10), awRdpao, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRdpao, type="l", lwd=1.5, lty=2) abline(h=0.33) mtext(side=2, text="Along", line=3.5, adj=0.5, cex=1) mtext(side=2, text="contour line", line=2.6, adj=0.5, cex=1) axis(side=2, at=seq(0.25,0.40,0.05), labels=c("0.25", "0.30", "0.35", "0.40"), cex.axis=1, las=1, hadj=0.8) screen(n=8) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moPlpef, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2) lines(seq(100, 1950, 10),awPlpef, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10)[1:150], crPlpef[1:150], type="l", lwd=1.5, lty=2) abline(h=0.33) legend("topright", legend="E", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) mtext(side=3, text="Power line", line=0.2, adj=0.5, cex=1.1) screen(n=9) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moPlpaf, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2, xaxt="n") lines(seq(100, 1950, 10), awPlpaf, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crPlpaf, type="l", lwd=1.5, lty=2) legend("topright", legend="F", bg="white", cex=1.3, box.col="black",bty="n") abline(h=0.245, lwd=2) abline(h=0.33) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) screen(n=10) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moPlpeo, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2, xaxt="n") lines(seq(100, 1950, 10), awPlpeo, type="l", lwd=1.5, lty=3) lines(seq(100, 1500, 10), crPlpeo[1:141], type="l", lwd=1.5, lty=2) legend("topright", legend="G", bg="white", cex=1.3, box.col="black",bty="n") abline(h=0.405, lwd=4) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) abline(h=0.33) screen(n=11) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moPlpao, type="l", ylim=c(0.25,0.4), las=1, yaxt="n", lwd=2, cex.axis=1, padj=-0.8) lines(seq(100, 1950, 10), awPlpao, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crPlpao, type="l", lwd=1.5, lty=2) legend("topright", legend="H", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) mtext(side=1, text="Distance to linear feature (m)", line=1.7,cex=1.2) #, adj=3, abline(h=0.33) screen(n=12) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRipef, type="l", ylim=c(0.25,0.4), las=1, lwd=2, yaxt="n", xaxt="n") lines(seq(100, 1950, 10), awRipef, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRipef, type="l", lwd=1.5, lty=2) abline(h=0.33) legend("topright", legend="I", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) mtext(side=3, text="River", line=0.2, adj=0.5, cex=1.1) screen(n=13) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRipaf, type="l", ylim=c(0.25,0.4), las=1, yaxt="n", lwd=2, xaxt="n") lines(seq(100, 1950, 10), awRipaf, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRipaf, type="l", lwd=1.5, lty=2) abline(h=0.245, lwd=2) legend("topright", legend="J", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) abline(h=0.33) screen(n=14) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRipeo, type="l", ylim=c(0.25,0.4), las=1, yaxt="n", lwd=2, xaxt="n") abline(h=0.405, lwd=4) lines(seq(100, 1950, 10), awRipeo, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRipeo, type="l", lwd=1.5, lty=2) legend("topright", legend="K", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) abline(h=0.33) screen(n=15) par(mar=c(0,0,0,0)) par(xpd=T) plot(seq(100, 1950, 10), moRipao, type="l", ylim=c(0.25,0.4), las=1, yaxt="n", lwd=2, cex.axis=1, padj=-0.8) lines(seq(100, 1950, 10), awRipao, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRipao, type="l", lwd=1.5, lty=2) abline(h=0.33) legend("topright", legend="L", bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) par(xpd=NA) legend("bottomright", legend=c( "Moving along linear feature", "Moving towards linear feature", "Moving away from linear feature"), lty=c(1, 2, 3), seg.len=4, bg="white", bty="n", lwd=c(2,2,2),cex=1, inset=c(0.6,-0.75)) par(xpd=T) dev.off() ##################################################################### ### changes in movements with distance to linear feature combinations ##################################################################### #### derive linear predictor for movements towards road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[5] # movements along road/river combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- di # distances for movements along road/river combinations andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for moving towards road/river combinations crRdRi <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdRi[1] #### probability for moving along road/river combinations moRdRi <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdRi[1] #### probability for moving away from road/river combinations awRdRi <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdRi[1] #### derive linear predictor for movements towards road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[6] # movements along road/power line combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- di # distances for movements along road/power line combinations andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- di # distances to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distances to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movements along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movements along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for movements towards road/power line combinations crRdPl <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdPl[1] #### probability for movements along road/power line combinations moRdPl <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdPl[1] #### probability for movements away from road/power line combinations awRdPl<- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdPl[1] #### derive linear predictor for movements towards power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)-50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10) # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[7] # movements along power line/river combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- di # distances for movements along power line/river combinations lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- seq(100, 1950, 10)+50 # distances to closest linear feature diq <- di^2 # squared distances to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no option to cross linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no option to cross linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no option to cross linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no option to cross linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movements along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movements along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors # probability for moving towards power line/river combinations crPlRi <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlRi[1] # probability for moving along power line/river combinations moPlRi <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlRi[1] # probability for moving away from power line/river combinations awPlRi <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlRi[1] #### make graph with predictions (Fig.4) tiff(2000,1000,filename = "//fig4.tiff", res = 450, compression ="lzw", pointsize="8") close.screen(1:100) par(mar=c(0,0,0,0)) split.screen(c(1,3)) close.screen() par(mar=c(0,0,0,0), omi=c(0.82,0.48,0.18,0.13), bg="white") #‘c(bottom, left, top, right)’ # (bottom, left, top, right) screen(n=1) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRdRi, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, yaxt="n", lwd=2) lines(seq(100, 1950, 10), awRdRi, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crRdRi, type="l", lwd=1.5, lty=2) abline(h=0.33) mtext(side=3, text="Road/River", line=0.2, cex=1.1, outer=T, adj=0.1) mtext(side=2, text="Step selection probability", line=2.5, cex=1.2, outer=T) legend("topright", legend=c( "A"), bg="white", cex=1.3, box.col="black",bty="n") axis(side=2, at=seq(0.25,0.4,0.05), labels=c("0.25", "0.30","0.35", "0.40"), cex.axis=1, las=1, hadj=0.8) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) axis(side=1, at=seq(0,2000,500), labels=c(NA,500,NA,1500, NA), cex.axis=1, padj=-0.8) screen(n=2) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moRdPl, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, lwd=3, yaxt="n", col="white") legend("topright", legend=c( "B"), bg="white", cex=1.3, box.col="black",bty="n") lines(seq(100, 1950, 10), moRdPl, type="l", lwd=2, lty=1) lines(seq(100, 1950, 10), awRdPl, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10)[1:160], crRdPl[1:160], type="l", lwd=1.5, lty=2) length(seq(100, 1500, 10)) abline(h=0.33) mtext(side=3, text="Road/Power line", line=0.2, cex=1.1, outer=T) axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) mtext(side=1, text="Distance to linear features (m)", line=1.7, cex=1.2, outer=T) axis(side=1, at=seq(0,2000,500), labels=c(NA,500,NA,1500,NA), cex.axis=1, padj=-0.8) screen(n=3) par(mar=c(0,0,0,0)) plot(seq(100, 1950, 10), moPlRi,, type="l", ylim=c(0.25,0.4), xaxt="n", las=1, cex.axis=1.2, lwd=2, yaxt="n") lines(seq(100, 1950, 10), awPlRi, type="l", lwd=1.5, lty=3) lines(seq(100, 1950, 10), crPlRi, type="l", lwd=1.5, lty=2) abline(h=0.33) mtext(side=3, text="Power line/River", line=0.2, cex=1.1, outer=T, adj=0.94) legend("topright", legend=c( "C"), bg="white", cex=1.3, box.col="black",bty="n") axis(side=1, at=seq(0, 2000, 500), labels=F, cex.axis=1, las=1, outer=F, tck=0.08) axis(side=1, at=seq(0,2000,500), labels=c(NA,500,NA,1500,NA), cex.axis=1, padj=-0.8) par(xpd=NA) legend("bottomright", legend=c( "Moving along linear feature", "Moving towards linear feature", "Moving away from linear feature"), lty=c(1, 2, 3), seg.len=3.5, bg="white", bty="n", lwd=c(2,2,2),cex=1, inset=c(0.7,-0.7)) par(xpd=T) dev.off() rm("mco") gc() #### equivalent model to the combined model for the period April - December #### analyzing moose step selection #### including the effects of the basic model #### as well es barrier and corridor effects of different linear features #### and linear feature combinations moose$date <- as.character(moose$date) moose$month <- as.integer(substring(moose$date,6,7)) moose1 <- moose[!(moose$month==1 |moose$month==2 |moose$month==3),] d <- datadist(moose1) options(datadist="d") gc() mco <- cph(Surv(rep(1, nrow(moose1)), sel) ~ length+ elevdm+ forest+ elevs+ elevsq+ mind+ mindq+ dityRd+ dityRi+ dityqRd+ dityqRi+ cr+ crf+ crpa+ andiRd+ andiPl+ andiRi+ andiRdRi+ andiPlRd+ andiPlRi+ type3+ fty2+ typa+ andiRd2+ andiPl2+ andiRi2+ andiRdRi2+ andiPlRd2+ andiPlRi2+ strat(set)+ cluster(clus), data=moose1, method = "exact", tol=1e-16, x=TRUE) ########################################################### ## predictions for movements at the edge (25m distance) of linear features ########################################################### #### these variables are held at their mean values for all predictions le <- 100 # assume step length of 100 meters ed <- mean(moose$elevdm[moose$sel==1]) # mean elevation difference along steps dE <- mean(moose$elevs[moose$sel==1]) # mean elevation at endpoint of steps dEq <- dE^2 # squared mean elevation at endpoint of steps setn <- moose1$set[1] # the set of steps is irrelevant for the predictions #### derive linear predictor for steps crossing roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # road crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # road crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement through forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along road when not aligned along contour line levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di ^ # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movement steps away from roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors # probability for crossing roads in forest, when not aligned along contour lines crRdpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpef # probability for moving along roads in forest, when not aligned along contour lines moRdpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpef # probability for moving away from roads in forest, when not aligned along contour lines awRdpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpef #### derive linear predictor for steps crossing roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # road crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[2] # road crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along road # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for steps along roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along road in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[2] # movement along road when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads in forests, when aligned along contour lines crRdpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpaf #### probability for moving along roads in forests, when aligned along contour lines moRdpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpaf #### probability for moving away from roads in forests, when aligned along contour lines awRdpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpaf #### derive linear predictor for crossing roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[2] # road crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # road crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[2] # movement along road in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along road when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads in open habitats #### roads not aligned along contour lines crRdpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpeo #### probability for moving along roads in open habitats #### roads not aligned along contour lines moRdpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpeo #### probability for moving away from roads in open habitats #### roads not aligned along contour lines awRdpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpeo #### derive linear predictor for crossing roads in open habitats #### roads aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[2] # road crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[2] # road crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[2] # road crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiRin <- 0 andiPln <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along roads in open habitats #### road aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[2] # movement along road levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[2] # movement along road in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[2] # movement along road when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from road in open habitats #### road aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing road in open habitats #### road aligned along countour lines crRdpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpao #### probability for moving along road in open habitats #### road aligned along countour lines moRdpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpao #### probability for moving away from roads in open habitats #### road aligned along contour lines awRdpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpao #### derive linear predictor for crossing power lines in forest #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqPln <- dityPln^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # power line crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # power line crossed when not aligned along contour lines levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 25 # power line crossed at 25m distance andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power lines in forests #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along power line in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along power line when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 25 # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco, newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power lines in forests #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco, newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in forest #### power lines not aligned along contour lines crPlpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpef #### probability for moving along power lines in forest #### power lines not aligned along contour lines moPlpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpef #### probability of moving away from power lines in forest #### power lines not aligned along contour lines awPlpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpef #### derive linear predictor for crossing power lines in forest #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # power line crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[3] # power line crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl= andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear preditor for moving along power lines in forest #### power lines are aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # in forest # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along power line in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[3] # movement along power line when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 25 # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power lines in forest #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in forest #### power line aligned along contour line crPlpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpaf #### probability for moving along power line in forest #### power line aligned along contour line moPlpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpaf #### probability for moving away from power line in forest #### power line aligned along contour line awPlpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpaf #### derive linear predictor for crossing power lines in open habitats #### power lines not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$crf)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[3] # power line crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # power line crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power line in open habitats #### power line not aligned along contour line forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to linear closest feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[3] # movement along power line in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along power line when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power line in open habiats #### power line not aligned along contour line forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in open habitats #### power lines not aligned along contour lines crPlpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpeo #### probability for moving along power lines in open habitats #### power lines not aligned along contour lines moPlpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpeo #### probability for moving away from power lines in open habitats #### power lines not aligned along contour lines awPlpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpeo #### derive linear predictor for crossing power lines in open habitats #### power lines aligend along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[3] # power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[3] # power line crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[3] # power line crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power lines in open habitats #### power lines aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[3] # movement along power line levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[3] # movement along power line in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[3] # movement along power line when aligned along contour line levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # movement along power line at 25m distance andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power line in open habitats #### power line aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in open habitats #### power lines aligned along contour lines crPlpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpao #### probability for moving along power lines in open habitats #### power lines aligned along contour lines moPlpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpao #### probability for moving away from power lines in open habitats #### power lines aligned along contour lines awPlpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpao #### derive linear predictor for crossing rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # river crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # river crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along river in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along river when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPl2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in forests #### river not aligned along contour lines crRipef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipef #### probability for moving along rivers in forests #### river not aligned along contour lines moRipef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipef #### probability for moving away from rivers in forests #### river not aligned along contour lines awRipef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipef #### derive linear predictor for crossing rivers in forest #### rivers aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # river crossed in forest levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[4] # river crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in forest #### river aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # movement along river in forest levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[4] # movement along river when aligned along contour line levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from a rivers in forest #### river aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance from closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance from closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 # no crossing of linear features andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear feature levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear feature levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear feature levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in forests #### rivers aligned along contour lines crRipaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipaf #### probability for moving along rivers in forests #### rivers aligned along contour lines moRipaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipaf #### probability for moving away from rivers in forests #### rivers aligned along contour lines awRipaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipaf #### derive linear predictor for crossing rivers in open habitats #### river not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[4] # river crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # river crossed when not aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers #### rivers not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[4] # movement along river in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # movement along river when not aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPlRd2n <- 0 andiPlRi2n <- 0 andiRdRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers #### river not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in open habitats #### rivers not aligned along contour lines crRipeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipeo #### probability for moving along rivers in open habitats #### rivers not aligned along contour lines moRipeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipeo #### probability for moving away from rivers in open habitats #### rivers not aligned along contour lines awRipeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipeo #### derive linear predictor for crossing rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[4] # river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[4] # river crossed in open habitats levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[4] # river crossed when aligned along contour line levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25 distance andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[4] # movement along river levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[4] # movement along river in open habitats levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[4] # movement along river when aligned along contour lines levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in open habitats #### river aligned along contour lines crRipao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipao #### probability for moving along rivers in open habitats #### river aligned along contour lines moRipao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipao #### probability for moving away from rivers in open habitats #### river aligned along contour lines awRipao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipao #### linear feature combinations #### derive linear predictor for crossing roads and rivers forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[5] # road and river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # interaction with forest cover not specified levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # interaction with alignment along contour lines not specified levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- 0 andiRdRin <- di # 25m distance from closest road when crossing andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 andiRdRin <- 0 type3n <- levels(moose$type3)[5] # movement along road/river combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- di # movement along road/river combinations at 25m distance andiPlRd2n <- 0 andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors ## derive linear predictor for moving away from road/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing road/river combinations crRdRi <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdRi #### probability for moving along road/river combinations moRdRi <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdRi #### probability for moving away from road/river combinations awRdRi <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdRi #### derive linear predictor for crosssing roads and power lines forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[6] # road and power line crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # interaction with forest cover not specified levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # interaction with alignment along contour lines not specified levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- di # road and power line crossed at 25m distance andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 typan <- levels(moose$typa)[1] crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[6] # movement along road/power line combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- di # movement along road/power line combinations at 25m distance andiPlRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors ## moving away from road/power line combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads and power lines crRdPl <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdPl #### probability for moving along road/power line combinations moRdPl <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdPl #### probability for moving away from road/power line combinations awRdPl <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdPl #### derive linear predictor for crossing power lines and rivers forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[7] # power line and river crossed levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # interaction with forest cover not specified [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # interaction with alignment along contour lines not specified levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 25 # power line and river crossed at 25m distance type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[7] # movement along power line/river combinations levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # interaction with forest cover not specified levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # interaction with alignment along contour lines not specified levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- di # movement along power line/river combinations at 25m distance lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power line/river combinations forest <- factor(1,levels=1:2,labels=levels(moose$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose$cr)[1] # no crossing of linear features levels(moose$cr) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" crfn <- levels(moose$crf)[1] # no crossing of linear features levels(moose$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose$crpa)[1] # no crossing of linear features levels(moose$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 andiRdRin <- 0 andiPlRdn <- 0 andiPlRin <- 0 type3n <- levels(moose$type3)[1] # no movement along linear features levels(moose$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose$fty2)[1] # no movement along linear features levels(moose$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose$typa)[1] # no movement along linear features levels(moose$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 andiRdRi2n <- 0 andiPlRd2n <- 0 andiPlRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, andiRdRi=andiRdRin, andiPlRd=andiPlRdn, andiPlRi=andiPlRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n, andiRdRi2=andiRdRi2n, andiPlRd2=andiPlRd2n, andiPlRi2=andiPlRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines and rivers crPlRi <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlRi #### probability for moving along power line/river combinations moPlRi <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlRi #### probability for moving away from power line/river combinations awPlRi <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlRi #### combined model for the coldest period January - March #### analyzing moose step selection #### including the effects of the basic model #### as well es barrier and corridor effects of different linear features, #### but not linear feature combinations rm("moose1") rm("mco") gc() #### remove all sets of steps with crossings of or movements along linear feature combinations moose1 <- moose[moose$month==1 |moose$month==2 |moose$month==3,] nFID <- unique(moose1$set[(moose1$cr=="RdRi"|moose1$cr=="PlRd"|moose1$cr=="PlRi"| moose1$type3=="RdRi"|moose1$type3=="PlRd"|moose1$type3=="PlRi")]) nFID <- unique(nFID) length(nFID) moose2 <- moose1 moose2 <- moose2[-match(nFID, moose2$set),] # this only removes the first set, but not all of them # have to repeat this step five times more to remove all the unwanted sets #1 moose2 <- moose2[!is.na(moose2$set),] moose2 <- moose2[-match(nFID, moose2$set),] #2 moose2 <- moose2[!is.na(moose2$set),] moose2 <- moose2[-match(nFID, moose2$set),] #3 moose2 <- moose2[!is.na(moose2$set),] moose2 <- moose2[-match(nFID, moose2$set),] #4 moose2 <- moose2[!is.na(moose2$set),] moose2 <- moose2[-match(nFID, moose2$set),] #5 moose2 <- moose2[!is.na(moose2$set),] moose2 <- moose2[-match(nFID, moose2$set),] moose2 <- moose2[!is.na(moose2$set),] moose1 <- moose2 unique(moose1$cr) moose1$cr <- factor(moose1$cr, levels=c("no","Rd", "Pl", "Ri")) moose1$crf <- factor(moose1$crf, levels=c("no", "Rd", "Pl", "Ri")) moose1$crpa <- factor(moose1$crpa, levels=c("no", "Rd", "Pl", "Ri")) moose1$type3 <- factor(moose1$type3, levels=c("no", "Rd", "Pl", "Ri")) moose1$fty2 <- factor(moose1$fty2, levels=c("no", "Rd", "Pl", "Ri")) moose1$typa <- factor(moose1$typa, levels=c("no", "Rd", "Pl", "Ri")) rm("moose2") gc() d <- datadist(moose1) options(datadist="d") gc() mco <- cph(Surv(rep(1, nrow(moose1)), sel) ~ length+ elevdm+ forest+ elevs+ elevsq+ mind+ mindq+ dityRd+ dityRi+ dityqRd+ dityqRi+ cr+ crf+ crpa+ andiRd+ andiPl+ andiRi+ type3+ fty2+ typa+ andiRd2+ andiPl2+ andiRi2+ strat(set)+ cluster(clus), data=moose1, method = "exact", tol=1e-16, x=TRUE) ########################################################### ## movements at the edge (25m distance) of linear features ########################################################### #### these variables are held at their mean values for all predictions le <- 100 # assume step length of 100 meters ed <- mean(moose1$elevdm[moose1$sel==1]) # mean elevation difference along steps dE <- mean(moose1$elevs[moose1$sel==1]) # mean elevation at endpoint of steps dEq <- dE^2 # squared mean elevation at endpoint of steps setn <- moose1$set[1] # the set of steps is irrelevant for the predictions #### derive linear predictor for steps crossing roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[2] # road crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # road crossed in forest levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # road crossed when not aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear feature levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear feature levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear feature levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for movements along roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[2] # movement along road levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # movement through forest levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # movement along road when not aligned along contour line levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di ^ # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movement steps away from roads in forests #### road is not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 75 # 75m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors # probability for crossing roads in forest, when not aligned along contour lines crRdpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpef # probability for moving along roads in forest, when not aligned along contour lines moRdpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpef # probability for moving away from roads in forest, when not aligned along contour lines awRdpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpef #### derive linear predictor for steps crossing roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[2] # road crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # road crossed in forest levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[2] # road crossed when aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear feature levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear feature levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along road # no movement along linear feature levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for steps along roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[2] # movement along road levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # movement along road in forest levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[2] # movement along road when aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from roads in forests #### roads aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 75 # 75m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads in forests, when aligned along contour lines crRdpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpaf #### probability for moving along roads in forests, when aligned along contour lines moRdpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpaf #### probability for moving away from roads in forests, when aligned along contour lines awRdpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpaf #### derive linear predictor for crossing roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[2] # road crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[2] # road crossed in open habitats levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # road crossed when not aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[2] # movement along road levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[2] # movement along road in open habitats levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # movement along road when not aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from roads in open habitats #### roads not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing roads in open habitats #### roads not aligned along contour lines crRdpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpeo #### probability for moving along roads in open habitats #### roads not aligned along contour lines moRdpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpeo #### probability for moving away from roads in open habitats #### roads not aligned along contour lines awRdpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpeo #### derive linear predictor for crossing roads in open habitats #### roads aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[2] # road crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[2] # road crossed in open habitats levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[2] # road crossed when aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- di # road crossed at 25m distance andiRin <- 0 andiPln <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along roads in open habitats #### road aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 25m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[2] # movement along road levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[2] # movement along road in open habitats levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[2] # movement along road when aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- di # movement along road at 25m distance andiPl2n <- 0 andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from road in open habitats #### road aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- di # 75 m distance to closest road dityRin <- 0 dityqRdn <- dityRdn^2 # squared distance to closest road dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing road in open habitats #### road aligned along countour lines crRdpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRdpao #### probability for moving along road in open habitats #### road aligned along countour lines moRdpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRdpao #### probability for moving away from roads in open habitats #### road aligned along contour lines awRdpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRdpao #### derive linear predictor for crossing power lines in forest #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqPln <- dityPln^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[3] # power line crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # power line crossed in forest levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # power line crossed when not aligned along contour lines levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 25 # power line crossed at 25m distance andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power lines in forests #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[3] # movement along power line levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # movement along power line in forest levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # movement along power line when not aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 25 # movement along power line at 25m distance andiRi2n <- 0 lp2 <- prcph2(mco, newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power lines in forests #### power lines not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear feature levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear feature levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear feature levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco, newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in forest #### power lines not aligned along contour lines crPlpef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpef #### probability for moving along power lines in forest #### power lines not aligned along contour lines moPlpef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpef #### probability of moving away from power lines in forest #### power lines not aligned along contour lines awPlpef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpef #### derive linear predictor for crossing power lines in forest #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[3] # power line crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # power line crossed in forest levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[3] # power line crossed when aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl= andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear preditor for moving along power lines in forest #### power lines are aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # in forest # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 # no crossing of linear features andiRin <- 0 type3n <- levels(moose1$type3)[3] # movement along power line levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # movement along power line in forest levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[3] # movement along power line when aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 25 # movement along power line at 25m distance andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power lines in forest #### power lines aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in forest #### power line aligned along contour line crPlpaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpaf #### probability for moving along power line in forest #### power line aligned along contour line moPlpaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpaf #### probability for moving away from power line in forest #### power line aligned along contour line awPlpaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpaf #### derive linear predictor for crossing power lines in open habitats #### power lines not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$crf)[3] # power line crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[3] # power line crossed in open habitats levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # power line crossed when not aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power line in open habitats #### power line not aligned along contour line forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to linear closest feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[3] # movement along power line levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[3] # movement along power line in open habitats levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # movement along power line when not aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # movement along power line at 25m distance andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from power line in open habiats #### power line not aligned along contour line forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in open habitats #### power lines not aligned along contour lines crPlpeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpeo #### probability for moving along power lines in open habitats #### power lines not aligned along contour lines moPlpeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpeo #### probability for moving away from power lines in open habitats #### power lines not aligned along contour lines awPlpeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpeo #### derive linear predictor for crossing power lines in open habitats #### power lines aligend along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[3] # power line crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[3] # power line crossed in open habitats levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[3] # power line crossed when aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- di # power line crossed at 25m distance andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along power lines in open habitats #### power lines aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[3] # movement along power line levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[3] # movement along power line in open habitats levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[3] # movement along power line when aligned along contour line levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- di # movement along power line at 25m distance andiRi2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for movements away from power line in open habitats #### power line aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- 0 dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing power lines in open habitats #### power lines aligned along contour lines crPlpao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crPlpao #### probability for moving along power lines in open habitats #### power lines aligned along contour lines moPlpao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moPlpao #### probability for moving away from power lines in open habitats #### power lines aligned along contour lines awPlpao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awPlpao #### derive linear predictor for crossing rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[4] # river crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # river crossed in forest levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # river crossed when not aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[4] # movement along river levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # movement along river in forest levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # movement along river when not aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiRi2n <- di # movement along river at 25m distance andiPl2n <- 0 lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers in forest #### river not aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 # no movement along linear features andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in forests #### river not aligned along contour lines crRipef <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipef #### probability for moving along rivers in forests #### river not aligned along contour lines moRipef <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipef #### probability for moving away from rivers in forests #### river not aligned along contour lines awRipef <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipef #### derive linear predictor for crossing rivers in forest #### rivers aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[4] # river crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # river crossed in forest levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[4] # river crossed when aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in forest #### river aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 25 # 25 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[4] # movement along river levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # movement along river in forest levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[4] # movement along river when aligned along contour line levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from a rivers in forest #### river aligned along contour lines forest <- factor(1,levels=1:2,labels=levels(moose1$forest)) # in forest di <- 75 # 75 m distance from closest linear feature diq <- di^2 # squared distance from closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance from closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance from closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 # no crossing of linear features andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear feature levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear feature levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear feature levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear feature andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in forests #### rivers aligned along contour lines crRipaf <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipaf #### probability for moving along rivers in forests #### rivers aligned along contour lines moRipaf <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipaf #### probability for moving away from rivers in forests #### rivers aligned along contour lines awRipaf <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipaf #### derive linear predictor for crossing rivers in open habitats #### river not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[4] # river crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[4] # river crossed in open habitats levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # river crossed when not aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25m distance type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers #### rivers not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[4] # movement along river levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[4] # movement along river in open habitats levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # movement along river when not aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers #### river not aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in open habitats #### rivers not aligned along contour lines crRipeo <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipeo #### probability for moving along rivers in open habitats #### rivers not aligned along contour lines moRipeo <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipeo #### probability for moving away from rivers in open habitats #### rivers not aligned along contour lines awRipeo <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipeo #### derive linear predictor for crossing rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[4] # river crossed levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[4] # river crossed in open habitats levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[4] # river crossed when aligned along contour line levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 andiPln <- 0 andiRin <- di # river crossed at 25 distance type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" "RdRi" "PlRd" "PlRi" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp1 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse1 <- lp1$se.fit lp1 <- lp1$linear.predictors #### derive linear predictor for moving along rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 25 # 25m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 25m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[4] # movement along river levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[4] # movement along river in open habitats levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[4] # movement along river when aligned along contour lines levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 andiPl2n <- 0 andiRi2n <- di # movement along river at 25m distance lp2 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse2 <- lp2$se.fit lp2 <- lp2$linear.predictors #### derive linear predictor for moving away from rivers in open habitats #### rivers aligned along contour lines forest <- factor(2,levels=1:2,labels=levels(moose1$forest)) # in open habitats di <- 75 # 75 m distance to closest linear feature diq <- di^2 # squared distance to closest linear feature dityRdn <- 0 dityRin <- di # 75 m distance to closest river dityqRdn <- dityRdn^2 dityqRin <- dityRin^2 # squared distance to closest river crn <- levels(moose1$cr)[1] # no crossing of linear features levels(moose1$cr) [1] "no" "Rd" "Pl" "Ri" crfn <- levels(moose1$crf)[1] # no crossing of linear features levels(moose1$crf) [1] "no" "Rd" "Pl" "Ri" crpan <- levels(moose1$crpa)[1] # no crossing of linear features levels(moose1$crpa) [1] "no" "Rd" "Pl" "Ri" andiRdn <- 0 # no crossing of linear features andiPln <- 0 andiRin <- 0 type3n <- levels(moose1$type3)[1] # no movement along linear features levels(moose1$type3) [1] "no" "Rd" "Pl" "Ri" fty2n <- levels(moose1$fty2)[1] # no movement along linear features levels(moose1$fty2) [1] "no" "Rd" "Pl" "Ri" typan <- levels(moose1$typa)[1] # no movement along linear features levels(moose1$typa) [1] "no" "Rd" "Pl" "Ri" andiRd2n <- 0 # no movement along linear features andiPl2n <- 0 andiRi2n <- 0 lp3 <- prcph2(mco,newdata=data.frame(set=setn, length=le, elevdm=ed, forest=forest, elevs=dE, elevsq=dEq, mind=di, mindq=diq, dityRd=dityRdn, dityRi=dityRin, dityqRd=dityqRdn, dityqRi=dityqRin, cr=crn, crf=crfn, crpa=crpan, andiRd=andiRdn, andiPl=andiPln, andiRi=andiRin, type3=type3n, fty2=fty2n, typa=typan, andiRd2=andiRd2n, andiPl2=andiPl2n, andiRi2=andiRi2n ), type="lp", se.fit=T) lpse3 <- lp3$se.fit lp3 <- lp3$linear.predictors #### probability for crossing rivers in open habitats #### river aligned along contour lines crRipao <- as.numeric(exp(lp1)/(exp(lp1)+exp(lp2)+exp(lp3))) crRipao #### probability for moving along rivers in open habitats #### river aligned along contour lines moRipao <- as.numeric(exp(lp2)/(exp(lp1)+exp(lp2)+exp(lp3))) moRipao #### probability for moving away from rivers in open habitats #### river aligned along contour lines awRipao <- as.numeric(exp(lp3)/(exp(lp1)+exp(lp2)+exp(lp3))) awRipao