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

Issue Running 04_ew4d_CI.R #2

Open
jconrad4 opened this issue Jul 12, 2017 · 0 comments
Open

Issue Running 04_ew4d_CI.R #2

jconrad4 opened this issue Jul 12, 2017 · 0 comments

Comments

@jconrad4
Copy link

I am running through your code trying to understand how the graphs were made. I keep coming across the following problem,
When I run this code:
`library(mgcv)

attach(training)
form <- as.formula("dengue ~ s(templ3,k=4)+s(rainl2,k=4)+s(rainl3,k=4)+s(denguel2,k=4)+s(denguel24,k=4)")
mod.train <- gam(form, family=quasipoisson, na.action=na.exclude, data=training)
detach(training)`

I receive the following results:

attach(training)
The following objects are masked by .GlobalEnv:

census, dengue, denguel0, denguel1, denguel2, denguel24, denguel3, denguel4, hum, huml0, huml1, huml2, huml3, huml4, month, rain, rainl0,
rainl1, rainl2, rainl3, rainl4, temp, templ0, templ1, templ2, templ3, templ4, X, year

The following objects are masked from training (pos = 3):

census, dengue, dengue_ma0211, dengue_ma0212, dengue_ma0213, dengue_ma0223, dengue_ma0224, dengue_ma0225, dengue_ma0235, dengue_ma0236,
dengue_ma0237, dengue_ma0247, dengue_ma0248, dengue_ma0249, dengue_ma0259, dengue_ma0260, dengue_ma1136, dengue_ma1148, dengue_ma1248,
dengue_ma1323, dengue_ma1348, dengue_ma2324, dengue_ma2335, dengue_ma2337, dengue_ma2348, dengue_ma2425, dengue_ma2435, dengue_ma2437,
dengue_ma2448, dengue_ma2535, dengue_ma2548, dengue_ma3747, dengue_ma4959, denguel0, denguel1, denguel10, denguel11, denguel12, denguel13,
denguel14, denguel15, denguel16, denguel17, denguel18, denguel19, denguel2, denguel20, denguel21, denguel22, denguel23, denguel24, denguel25,
denguel26, denguel27, denguel28, denguel29, denguel3, denguel30, denguel31, denguel32, denguel33, denguel34, denguel35, denguel36, denguel37,
denguel38, denguel39, denguel4, denguel40, denguel41, denguel42, denguel43, denguel44, denguel45, denguel46, denguel47, denguel48, denguel49,
denguel5, denguel50, denguel51, denguel52, denguel53, denguel54, denguel55, denguel56, denguel57, denguel58, denguel59, denguel6, denguel60,
denguel7, denguel8, denguel9, figures, hum, huml0, huml1, huml2, huml3, huml4, irA, irAl0, irAl1, irAl10, irAl11, irAl12, irAl13, irAl14,
irAl15, irAl16, irAl17, irAl18, irAl19, irAl2, irAl20, irAl21, irAl22, irAl23, irAl24, irAl25, irAl26, irAl27, irAl28, irAl29, irAl3, irAl30,
irAl31, irAl32, irAl33, irAl34, irAl35, irAl36, irAl37, irAl38, irAl39, irAl4, irAl40, irAl41, irAl42, irAl43, irAl44, irAl45, irAl46, irAl47,
irAl48, irAl49, irAl5, irAl50, irAl51, irAl52, irAl53, irAl54, irAl55, irAl56, irAl57, irAl58, irAl59, irAl6, irAl60, irAl7, irAl8, irAl9, irB,
irBl0, irBl1, irBl10, irBl11, irBl12, irBl13, irBl14, irBl15, irBl16, irBl17, irBl18, irBl19, irBl2, irBl20, irBl21, irBl22, irBl23, irBl24,
irBl25, irBl26, irBl27, irBl28, irBl29, irBl3, irBl30, irBl31, irBl32, irBl33, irBl34, irBl35, irBl36, irBl37, irBl38, irBl39, irBl4, irBl40,
irBl41, irBl42, irBl43, irBl44, irBl45, irBl46, irBl47, irBl48, irBl49, irBl5, irBl50, irBl51, irBl52, irBl53, irBl54, irBl55, irBl56, irBl57,
irBl58, irBl59, irBl6, irBl60, irBl7, irBl8, irBl9, month, rain, rainl0, rainl1, rainl2, rainl3, rainl4, temp, templ0, templ1, templ2, templ3,
templ4, time, X, year

form <- as.formula("dengue ~ s(templ3,k=4)+s(rainl2,k=4)+s(rainl3,k=4)+s(denguel2,k=4)+s(denguel24,k=4)")
mod.train <- gam(form, family=quasipoisson, na.action=na.exclude, data=training)
Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) :
NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning messages:
1: In mean.default(xx) : argument is not numeric or logical: returning NA
2: In Ops.factor(xx, shift[i]) : ‘-’ not meaningful for factors
detach(training)

How can I avoid this error? Did you manipulate the data you provided to omit NA's before running it?

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