similar to: How to calculate relative risk from GAM model in mgcv package?

Displaying 20 results from an estimated 100 matches similar to: "How to calculate relative risk from GAM model in mgcv package?"

2008 Aug 26
1
lattice: plotting an arbitrary number of panels, defining arbitrary groups
R Friends, I'm running R2.7.1 on Windows XP. I'm trying to get some lattice functionality which I have not seen previously documented--I'd like to plot the exact same data in multiple panels but changing the grouping variable each time so that each panel highlights a different feature of the data set. The following code does exactly that with a simple and fabricated air quality data
2008 Sep 05
0
text processing for plots
Hi R people, I want to write some functions to automate the plotting of some expressions that use some of the plotmath capabilities. An example is a string supplied to a plot call such as: plot(1, 1, ylab = "pm10 (ug/m3)") This should actually appear like: plot(1, 1, ylab = expression("PM"[10] * " (" * mu * "g m" ^-3 * ")")) i.e. pollutant
2012 Aug 07
2
Passing arguments to a function within a function ...
Hallo Everybody How do you specify arguments for a function used within another function? Here is my problem: I am reconstructing a calculator for the burden of disease due to air pollution from publications and tools published by the WHO. The calculations make use of published dose-response relationships for particular health end-points. This is then applied to populations with known or
2011 Jun 21
5
please help for mgcv package
i read a book from WOOD, there's an example which is talking about the pollutant. library(gamair) library(mgcv) y<-gam(death~s(time,bs="cr",k=200)+s(pm10median,bs="cr")+s(so2median,bs="cr")+s(o3median,bs="cr")+s(tmpd,bs="cr"),data=chicago,family=Possion) lag.sum<-function(a,10,11) {n<-length(a) b<-rep(0,n-11) for(i in 0:(11-10))
2013 Feb 17
3
Select components of a list
Hi Gustav, Try this: lapply(1:length(models),function(i) lapply(models[[i]],function(x) summary(x)$coef[2,]))[[1]] #1st list component [[1]] #??? Estimate?? Std. Error????? z value???? Pr(>|z|) # pm10 #5.999185e-04 1.486195e-04 4.036606e+00 5.423004e-05 #[[2]] #??? Estimate?? Std. Error????? z value???? Pr(>|z|) #ozone #0.0010117294 0.0003792739 2.6675428048 0.0076408155 #[[3]] #???
2008 Mar 07
0
How to do a time-stratified case-crossover analysis for air pollution data?
Dear Experts, I am trying to do a time-stratified case-crossover analysis on air pollution data and number of myocardial infarctions. In order to avoid model selection bias, I started with a simple simulation. I'm still not sure if my simulation is right. But the results I get from the "ts-case-crossover" are much more variable than those from a glm. Is this: a. Due to
2008 Mar 07
0
How to do a time-stratified case-crossover analysis for air pollution data? Unformatted text-version, with an additional note
Dear Experts, I am trying to do a time-stratified case-crossover analysis on air pollution data and number of myocardial infarctions. In order to avoid model selection bias, I started with a simple simulation. I'm still not sure if my simulation is right. But the results I get from the "ts-case-crossover" are much more variable than those from a glm. Is this: a. Due to the simple
2011 Aug 13
2
linear regression
dear R users, my data looks like this PM10 Ref UZ JZ WT RH FT WR 1 10.973195 4.338874 nein Winter Dienstag ja nein West 2 6.381684 2.250446 nein Sommer Sonntag nein ja Süd 3 62.586512 66.304869 ja Sommer Sonntag nein nein Ost 4 5.590101 8.526152 ja Sommer Donnerstag nein nein Nord 5 30.925054 16.073091 nein Winter Sonntag nein
2006 May 08
1
Help on zoo and datetime series
Hello, i would like to import this txt file: Giorno;PM10 2006-01-01 10:10;10.3 2006-02-02 20:22;50.3 2006-03-03 23:33;20.1 ......... As it's an irregular time series i use zoo as follow: require(zoo) z <- read.table("c:\\1.csv", sep=";", na.strings="-999", header=TRUE) q <- zoo(z$PM10, strptime(as.character(z$Giorno),"%Y-%m-%d %H:%M")) At this
2008 May 21
2
an unknown error message when using gamm function
Dear everyone, I'm encountering an unknown error message when using gamm function: > fitoutput <- gamm(cvd~as.factor(dow)+pm10+s(time,bs="cr",k=15,fx=TRUE)+s(tmean,bs="cr",k=7,fx=TRUE) + ,correlation=corAR1(form=~1|city),family=poisson,random=list(city=~pm10),data=mimp) Maximum number of PQL iterations: 20 iteration 1 iteration 2 iteration 3 iteration 4
2002 Dec 18
1
problem with 'gnls'
I'm working with data measured in a tunnel to estimate the emission factor of heavy & light vehicles. I tried to use 'gnls' and I get the following Error: >> Error in "coef<-.corARMA"(*tmp*, value = c(174.267493382104, 173.412740072763 : >> Coefficient matrix not invertible Here is my R-code: data <- d.plabutsch.neu # calculating the starting
2010 Mar 18
2
greek symbols on ylab=
Hi All, I'm trying to get following but not successfully: # this works okay ylab=expression("PM2.5 Concentration ("*mu*g/m^3*")") # But I need "2.5" as a subscript to PM and below this an additional line saying some text, like. ylab=expression("PM[2.5] Concentration ("*mu*g/m^3*")"\n(random text in brackets)) Square brackets doesn't
2012 Feb 13
2
finding and describing missing data runs in a time series
Hi - I am trying to find and describe missing data in a time series. For instance, in the library openair, there is a data frame called "mydata": library(openair) head(mydata) date ws wd nox no2 o3 pm10 so2 co pm25 1 1998-01-01 00:00:00 0.60 280 285 39 1 29 4.7225 3.3725 NA 2 1998-01-01 01:00:00 2.16 230 NA NA NA 37 NA NA NA 3 1998-01-01 02:00:00
2004 Jun 02
2
poisson regression with robust error variance ('eyestudy')
Dear all, i am trying to redo the 'eyestudy' analysis presented on the site http://www.ats.ucla.edu/stat/stata/faq/relative_risk.htm with R (1.9.0), with special interest in the section on "relative risk estimation by poisson regression with robust error variance". so i guess rlm is the function to use. but what is its equivalent to the glm's argument "family"
2024 Dec 02
1
Identify first row of each ID within a data frame, create a variable first =1 for the first row and first=0 of all other rows
OK. (Note: I am ccing this to the list so that others can correct any mistakes, misunderstandings, or misstatements that I may make; and also give you more and better advice about how to proceed. For example, there may be environmental packages ( see the environmetrics task view, https://CRAN.R-project.org/view=Environmetrics) that already do everything you want from your data source that someone
2004 Dec 22
2
GAM: Overfitting
I am analyzing particulate matter data (PM10) on a small data set (147 observations). I fitted a semi-parametric model and am worried about overfitting. How can one check for model fit in GAM? Jean G. Orelien
2008 May 08
2
poisson regression with robust error variance ('eyestudy
Ted Harding said: > I can get the estimated RRs from > RRs <- exp(summary(GLM)$coef[,1]) > but do not see how to implement confidence intervals based > on "robust error variances" using the output in GLM. Thanks for the link to the data. Here's my best guess. If you use the following approach, with the HC0 type of robust standard errors in the
2011 Aug 14
2
Central limit theorem
my data looks like this: PM10 Ref UZ JZ WT RH FT WR 1 10.973195 4.338874 nein Winter Dienstag ja nein West 2 6.381684 2.250446 nein Sommer Sonntag nein ja Süd 3 62.586512 66.304869 ja Sommer Sonntag nein nein Ost 4 5.590101 8.526152 ja Sommer Donnerstag nein nein Nord 5 30.925054 16.073091 nein Winter Sonntag nein nein Ost 6
2011 Sep 02
2
Chemical Names in Data Frames
Greetings - I am working on some data that contain chemical names with air concentrations, and I am creating a data frame with date/time and each chemical having its own column. However, these are organic chemicals (e.g. 1-butene, 2,3,4-trimethylbenzene etc). The package I am going to be using the data with is openair, and many of the great functions require you to specify a column name which
2004 Mar 12
0
Basic questions on nls and bootstrap
Dear R community, I have currently some problems with non linear regression analysis in R. My data correspond to the degradation kinetic of a pollutant in two different soil A and B, x data are time in day and y data are pollutant concentration in soil. In a first time, I want to fit the data for the soil A by using the Ct = C0*exp(-k*Tpst) with Ct the concentration of pollutant at time t, C0