Re: [R-sig-eco] [EXTERNAL] Error running an R code

2024-03-18 Thread Lee, Laura M
It sounds like one of your columns is all zeros. Look at the input data to make 
sure all observations have positive values.

-Original Message-
From: R-sig-ecology  On Behalf Of SANDILE 
N KHANYILE
Sent: Saturday, March 16, 2024 2:32 PM
To: r-sig-ecology@r-project.org
Subject: [EXTERNAL] [R-sig-eco] Error running an R code



 This email has been received from outside of DOI - Use caution before clicking 
on links, opening attachments, or responding.



Fellow Scientists,
Please help me. I have environmental data (73 observations and 8 variables) and 
species data (73 observations and 24 variables). After running code, get the 
following error:
Error in cca.default(d$X, d$Y, d$Z) :   all row sums must be >0 in the 
community data matrix
However the code run just fine when use another species data with more 
variables (73 observations and 169 variables) Thank You In advance.S. Khanyile

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] extracting variance components from lm

2017-07-21 Thread Lee, Laura
Hi all-

I have a fairly simple model:

m1 <- lm(Catch ~ Year + Station + Year*Station, data = data)

I would like to extract the among years and year*station variance components 
and need assistance. I'm aware of the 'varComp' package, but I believe that 
only applies to nlme and requires a random effect. Any help is greatly 
appreciated. Thanks!


Cheers,

Laura



Laura M. Lee
Senior Stock Assessment Scientist
Division of Marine Fisheries
Department of Environmental Quality

252 808 8094    office
252 726 6062    fax
mailto:laura@ncdenr.gov

3441 Arendell Street
P.O. Box 769
Morehead City, NC 28557-0769



Email correspondence to and from this address is subject to the
North Carolina Public Records Law and may be disclosed to third parties.

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] lognormal gamlss with censored data

2014-07-03 Thread Lee, Laura
Hello all!

I am fitting censored data with the 'gamlss' and 'survival' packages and 
assuming a lognormal distribution. Do I need to transform or back-transform the 
fitted values?

cy - with(data, ifelse(NUMBERS=Limit, Limit, NUMBERS))
ci - with(data, ifelse(NUMBERS=Limit, 0, 1))

data - data.frame(data, cy, ci)
rm(cy,ci)

gen.cens(LOGNO,type=right)
cfit - gamlss(Surv(cy, ci) ~ fyear + newWater, data=data, family=LOGNOrc)

Thanks for your help,

Laura

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] help with censored regression model

2014-07-03 Thread Lee, Laura
Hello all!

I am trying to model censored catch-per-unit-effort (CPUE) data. The data are 
censored by trip limits that vary by year. I am using the 'gamlss' and 
'survival' packages. My model covariates are Year and newWater. I need to get 
annual trends in CPUE by waterbody (newWater). After running the model and 
computing the index, I find the trends are the same among all water bodies--the 
magnitude is slightly different. I would not expect the trends to be the same 
among the different areas. I would appreciate any assistance. Code is below.

cy - with(data, ifelse(NUMBERS=Limit, Limit, NUMBERS))
ci - with(data, ifelse(NUMBERS=Limit, 0, 1))
data - data.frame(data, cy, ci)
rm(cy,ci)
gen.cens(LOGNO,type=right)
cfit - gamlss(Surv(cy, ci) ~ YEAR + newWater, data=data, family=LOGNOrc)
data$y - exp(fitted(cfit))
out - with(data, tapply(y, list(YEAR,newWater), mean))

Thanks again for your help,

Laura

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Prediction intervals for hurdle model

2014-06-18 Thread Lee, Laura
All-

I'm fitting a hurdle model using the 'pscl' package and would like to calculate 
standard errors and confidence intervals for the predicted values. I tried to 
apply the code found in the following thread: 
https://stat.ethz.ch/pipermail/r-help/2008-December/182806.html and was 
unsuccessful.

I would appreciate any help.

Thanks,

Laura

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] seeking guidance on mixture models

2014-05-19 Thread Lee, Laura
Hi all!

I'm interested in developing a mixture model that is a mixture of a negative 
binomial and a k-truncated negative binomial. I think this can be accomplished 
through one of the 'gamlss' packages, but I am seeking guidance and advice from 
someone who is experienced with doing this in R.

Thanks in advance for any and all help!

Cheers,

Laura 

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] k-truncated negative binomial

2014-05-16 Thread Lee, Laura
Hi all!

Is there a package or function to model data using a k-truncated negative 
binomial distribution? I know the truncated function in the 'aster' package can 
be used to simulate data, but I need to model.

Thanks!

Laura

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] compare zero-inflated zero-altered

2014-05-14 Thread Lee, Laura
Is there a test to compare zero-inflated to zero-altered models or is it not 
appropriate to compare in this way?

Thanks.

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] convergence problems for zero-inflated model

2013-09-23 Thread Lee, Laura
Hi all!

I'm using a zero-inflated model using the function 'zeroinfl' and running into 
convergence problems (system is computationally singular). How can I modify the 
code so it does not calculate a Hessian matrix?

Thanks,

Laura



E-mail correspondence to and from this address is subject to the North Carolina 
Public Records Law and may be disclosed to third parties unless the context is 
exempt by statute or other regulation.


[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] zeroinfl package - Year effect and precision

2012-02-06 Thread Lee, Laura
Hello. I originally posted this to the main R-help mailing list, but I'm afraid 
it got lost in the fray. 

I am using the zeroinfl package to fit a zero-inflated negative binomial. The 
explanatory variables are Year and Depth x STemp (interaction). I am in need of 
guidance for extracting the year effect and the associated precision.

Thank you for your time.

Cheers,

Laura

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology