Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weights and model formulation #17

Open
larspett opened this issue May 15, 2018 · 0 comments
Open

weights and model formulation #17

larspett opened this issue May 15, 2018 · 0 comments

Comments

@larspett
Copy link

larspett commented May 15, 2018

This model used to work in 1.x.x :
m2 <- try(trim(total_number ~ site + year, data=obsTidy, weight=obsTidy$freq, model=3, serialcor=TRUE,overdisp=TRUE))
I noticed that weight is now called weights and had heard that the obsTidy$freq specification was not needed anymore (hence freq should be sufficient)

When I run m2 <- try(trim(total_number ~ site + year, data=obsTidy, weights=obsTidy$freq, model=3, serialcor=TRUE,overdisp=TRUE)), I get the response

"Error in trim.formula(total_number ~ site + year, data = obsTidy, weights = obsTidy$freq, : argument 'weights' should be character"

When I then modify it to:

m2 <- try(trim(total_number ~ site + year, data=obsTidy, weights=freq, model=3, serialcor=TRUE,overdisp=TRUE)), I then get the response

"Error in trim.formula(total_number ~ site + year, data = obsTidy, weights = freq, : object 'freq' not found"

I finally get it working by the unexpected version (guided by the above error stating that 'weights' should be character) :

m2 <- try(trim(total_number ~ site + year, data=obsTidy, weights="freq", model=3, serialcor=TRUE,overdisp=TRUE))

So it looks like the variable name freq is not recognised. BTW obsTidy is a tibble that look like this:

A tibble: 564 x 4
site year total_number freq

1 107 2010 0 0.167
2 107 2011 0 0.5

Best wishes, Lars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant