search for: reduced_model

Displaying 3 results from an estimated 3 matches for "reduced_model".

2008 Feb 15
2
help on using try() to catch an error
Dear R Users, I have the following glm, which I am running several times in a loop (I am not including the full code): reduced_model <- NULL; full_model <- NULL; reduced_model <- try(glm.fit(X4,n,family=poisson(link="log"))) full_model <- try(glm.fit(X5,n,family=poisson(link="log"))); On some occasions, an error is produced, which is why I have attempted to work around this with try(). I then ha...
2008 Feb 20
1
debugging a try() statement
Dear R Users, I implemented a try() statement that looks like: <- function(index) { reduced_model <- try(glm.fit(X4,n,family=poisson(link="log"))) full_model <- try(glm.fit(X5,n,family=poisson(link="log"))) if (inherits(reduced_model,"try-error") || inherits(full_model,"try-error")) return(NA) else { p <- pchisq(reduced_model$d...
2008 Jan 25
1
increasing speed for permutations of glm
...RTpval <- function(index) { # A contingency table is formed from two columns of the data and the response (3 way table) and made into a vector counts <- as.vector(table(myData[,index[1]],myData[,index[2]], perm.response)); # Add 1 to any count that = 0. counts[counts == 0] <- 1 reduced_model <- glm.fit(X_red,counts,family=poisson(link="log")) full_model <- glm.fit(X_full,counts,family=poisson(link="log")) pval <- pchisq(reduced_model$deviance - full_model$deviance, reduced_model$df.residual - full_model$df.residual, lower.tail= FALSE) } for (perm i...