similar to: Help with tryCatch with a for loop

Displaying 20 results from an estimated 70 matches similar to: "Help with tryCatch with a for loop"

2008 Feb 15
1
How to plot fitted values from lmer (lme4 package)?
I am modelling (at least trying to) the seasonal component of a variable using lmer. I think I am just about getting the hang of building the models but want to see what the fitted values look like. I need to plot 2 lines on the same graph - the original data ( copy of dataframe below) and the fitted values. I am doing this to a) start to understand how to use R and b) start to understand how to
2010 Dec 04
2
Problem storing lm() model in a list
Hi all, I recently wrote some code to store a number of polynomial models in a list and return this list. The model is returned fine, but when I make a subsequent call to predict(), I have an error. The code for polyModel selection is listed at the end of the email. Here is an example of the error: > poly.fit <- polyModelSelection(x,y,10,F) > for (d in 1:4) { + lm.model <-
2011 Sep 23
1
Adding weights to optim
I realize this may be more of a math question. I have the following optim: optim(c(0.0,1.0),logis.op,x=d1_all$SOA,y=as.numeric(md1[,i])) which uses the following function: logis.op <- function(p,x,y) { ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2])); res <- sum((y-ypred)^2) return(res) } I would like to add weights to the optim. Do I have to alter the logis.op function by
2018 Jun 28
2
suma del resultado de multiplicar fila x columna
Buenas tardes, tengo 2 dfs: Dieta de (108x11) y Abund de (591x108). Necesito multiplicar cada columna de la 1ª (108 elementos) por cada fila de la 2ª (108 elementos) y crear una nueva df con las sumas de esas multiplicaciones. He hecho esto, pero no sale y creo que está lejos de estar bien: Res <- matrix(nrow=nrow(Abund),ncol=ncol(Dieta)) Res <- as.data.frame(Res) for(i in
2003 Mar 12
2
quasipoisson, glm.nb and AIC values
Dear R users, I am having problems trying to fit quasipoisson and negative binomials glm. My data set contains abundance (counts) of a species under different management regimens. First, I tried to fit a poisson glm: > summary(model.p<-glm(abund~mgmtcat,poisson)) Call: glm(formula = abund ~ mgmtcat, family = poisson) . . . (Dispersion parameter
2000 Jul 21
1
confint() error
Dear all, I have run the confint() function according to below and I get the following error message: > confint(stepAIC.glm.spe.var.konn2.abund, level=0.95) Waiting for profiling to be done... Error: missing value where logical needed In addition: Warning message: NaNs produced in: sqrt((fm$deviance - OriginalDeviance)/DispersionParameter) or > confint(stepAIC.glm.spe.var.konn2.abund,
2008 Apr 14
3
Logistic regression
Dear all, I am trying to fit a non linear regression model to time series data. If I do this: reg.logis = nls(myVar~SSlogis(myTime,Asym,xmid,scal)) I get this error message (translated to English from French): Erreur in nls(y ~ 1/(1 + exp((xmid - x)/scal)), data = xy, start = list(xmid = aux[1], : le pas 0.000488281 became inferior to 'minFactor' of 0.000976562 I then tried to set
2010 Oct 13
1
Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]
Hi all, When upgrading to 2.11.1 recently I noticed different results being produced by my code. After much digging I have finally narrowed it to a call to nlm(). This can be replicated by: FixedRemovals<-1836180125888 AbStageInitial<-2223033830403 Rates<- 0.3102445 nlm(function(rootM,Abund,Loss,OtherM) {(Loss-(rootM/(rootM+OtherM)* (1-exp(-(rootM+OtherM)))*
2012 Apr 17
3
error using nls with logistic derivative
Hi I?m trying to fit a nonlinear model to a derivative of the logistic function y = a/(1+exp((b-x)/c)) (this is the parametrization for the SSlogis function with nls) The derivative calculated with D function is: > logis<- expression(a/(1+exp((b-x)/c))) > D(logis, "x") a * (exp((b - x)/c) * (1/c))/(1 + exp((b - x)/c))^2 So I enter this expression in the nls function:
2013 Jun 07
0
error running mvabund package
Dear All, This is my first post, and probably (and hence apologies that) my question is very silly! I'm having issues with a the mvabund package (http://cran.r-project.org/web/packages/mvabund/index.html), and would be great to get some help! Here is the code (and files are attached): library(mvabund) ##visualizing data florabund <- read.csv("CPL_floristics_abund_v1d.csv",
2008 Aug 17
1
before-after control-impact analysis with R
Hello everybody, In am trying to analyse a BACI experiment and I really want to do it with R (which I find really exciting). So, before moving on I though it would be a good idea to repeat some known experiments which are quite similar to my own. I tried to reproduce 2 published examples but without much success. The first one in particular is a published dataset analysed with SAS by
2008 Mar 04
1
Plot with two different coloured regression lines and legend
It is a trivial problem, but in the book I couln`t figure out how to put different colours at different regression lines plot(bif,abund,type="n", xlab= "number_bifurcations", ylab="abundances") sbif<-split(bif,stage) sabund<-split(abund,stage) points(sabund[[2]],sbif[[2]],pch=16, col="red") for(i in 1:2) abline(lm(sabund[[i]]~sbif[[i]])) Thanks in
2011 Mar 03
1
Error in model.frame.default
Dear R- Community, to learn i reanalysed some data provided and analysed by Zuur et. al. in their book "Mixed effect models and Extensions in Ecology with R". When i run the last command i get a warning message i dont understand. Loyn<- read.table(file = "loyn.txt",header = TRUE) Loyn$L.AREA<- log10(Loyn$AREA) fGRAZE <-factor(Loyn$GRAZE) M0<- lm(ABUND~ L.AREA
2006 Jul 04
1
problem getting R 2.3.1 svn r38481 to pass make check-all
Hi, I noticed this problem on my home desktop running FC4 and again on my laptop running FC5. Both have previously compiled and passed make check-all on 2.3.1 svn revisions from 10 days ago or so. On both these machines, make check-all is consistently failing (4 out of 4 attempts on the FC 4 desktop and 3 out of 3 on the FC 5 laptop) in the p-r-random-tests tests. This is with both default
2009 May 10
2
Vignettes with missing or empty \VignetteIndexEntry:
Hi, I have a problem when checking the package 'probdistr' (on probability distributions). I got this warning * checking index information ... WARNING Vignettes with missing or empty \VignetteIndexEntry: [1] "probdistr-chi" "probdistr-contextra" "probdistr-discrete" [4] "probdistr-discrextra" "probdistr-exp"
1999 Dec 10
1
orthogonal and nested model
I'm working with a orthogonal and nested model (mixed). I have four factors, A,B,C,D; A and B are fixed and orthogonal C is nested in AB interaction and finally, D is nested in C. I would like to model the following Y_ijklm=Mu+A_i+B_j+AB_ij+C_k(ij)+D_l(k(ij))+Error_m(...) I used the next command >summary(aov(abund~A*B + C % in % A:B + D % in % C % in % A:B ,datos)) Is it the correct
2006 Jun 06
1
[OFF] The "best" tool for a space-temporal analyses?
Hi, I try to make an analyses to discover what is the time that an area begin to have spacial autocorrelation. And after, what is the number of individuals responsible for this autocorrelation. The main idea is to discover if exist a contamination of a quadrat from others quadrats and how is the population needed to make this contamination. This is very common to use automata to simulate
2012 Aug 02
1
summary(svyglm) Pr (> | t |) ?
Hello I want to know if the summary of the logistic model with survey Pr (> | t |) to test if the coefficient of the model is significant, ie is the p_valor wald test for the model coefficients, for I am interested to know if the three levels of the variable educational level are significant to the model (significance of handling 0.2), I present below the results of my model
2013 Feb 28
1
help for an R automated procedures
Dear, I would like to post the following question to the r-help on Nabble (thanks in advance for the attention, Gustavo Vieira): Hi there. I have a data set on hands with 5,220 cases and I'd like to automate some procedures (but I have almost no programming knowledge). The data has some continuous variables that are grouped by 2 others: the name of species and the locality where they were
2006 May 23
2
transpose dataset to PC-ORD?
Hello: I need to take a species-sample matrix and transpose it to the format used by PC-ORD for analysis. Unfortunately, the number of species is very large (>5000), and so this operation cannot be performed simply in an application like Excel, which has a 255 column limit. So, I wrote relatively simple code in R that I hoped would do this (appended below). But there are glitches. The