Displaying 20 results from an estimated 2000 matches similar to: "gam.check in gam (mgcv)"
2008 Jul 25
3
Help with rep
Hi
Is it possible to use the rep command (or maybe some other "shortcut") to create a vector with the following format:
4 3 4 2 3 4 1 2 3 4
Any help is much appreciated.
Thanks
Jacob
Jacob L van Wyk
Department of Statistics
University of Johannesburg, APK
Box 524
Auckland Park 2006
South Africa
Office Tel: +27 11 559 3080
Fax: +27 11 559 2832
[[alternative HTML version
2008 Jul 26
1
Help with matrix
Hi
I have 3 vectors, say g1, g2 and f, where g1 and g2 contain the row and column indices of a matrix, with corresponding elements in f. How can I create a matrix containing the values in f ?
For example:
g1 g2 f
3 4 10
2 1 30
4 4 50
How can then get a matrix that looks as follows:
0 0 0 0
30 0 0 0
0 0 0 10
0 0 0 50
I am still learning R. I think reshape will
2011 Apr 11
0
Question about GAM (mgcv)
Dear list,
i'm using the GAM function from mgcv package. I'm using this syntax:
model=gam(y~offset(x)+s(log1p(x1))+s(log1p(x2))+s(x3)+s(x4)+s(5),family=quasipoisson,data=data)
and I'm sequentially dropping the single term with the highest
non-significant p-value from the model and re-fitting until all term are
significant. Now I have:
2008 Mar 21
1
GAMs
Hi
I have been searching for goodness-of-fit tests (or lack of fit tests) for GAMs and cannot find anything.
My problem is: after fitting a GAM to mortality data (smoothing crude estimated rates of mortality - a process called graduation in the actuarial literature), (1) how to assess the fit of the model with reference to "adherence to data" for the fitted model (I do not think the
2011 Jun 09
0
Fwd: Re: residual checking for GAM (mgcv)
The plots look reasonable to me. The plot of residuals against linear
predictor always looks scary when many of the fitted values are very
close to zero, so I tend to look at residuals against sqrt(fitted) in
such cases. I don't think that the presence of the zero curve is a
reason to reject the model --- it's easy to produce such plots by
fitting a completely correct model to simulated
2023 Dec 06
0
How to calculate relative risk from GAM model in mgcv package?
Hi R users,I am a beginner in the use of R. I need urgent help for my
thesis study.
<https://stats.stackexchange.com/posts/633206/timeline>
I have daily air pollution parameters PM10, PM2.5 CO, NO2, SO2, and O3. I
also have daily hospital admission numbers. Taking into account the effect
of weekends and holidays, I would like to used generalised additive model
(GAM) to explore the
2013 Dec 05
0
mgcv gam modeling trend variation over cases
Dear R-Helpers,
I posted two days ago on testing significance of random effects in mgcv,
but realize I did not make my overall purpose clear. I have a series of
N short time series, where N might range from 3-10 and short means a
median of 20 time points. The sample data below (PCP) has N = 4 cases
with 9, 13, 16 and 16 observations over time respectively. The data set
contains four
2006 Mar 06
1
LocFit
I have a question regarding the package LOCFIT of C Loader.
After fitting a smooth surface (y modeled by two regressors), I can't
seem to find a nice way of making a perspective (or other 3d plot). The
contours don't look quite so good.
It is meant to be used as illustration of smoothing to my students in
regression analysis.
Could anybody perhaps assist me in producing a
2007 Sep 28
1
Help with "old" function in "base"
Hi
I think there was a built-in function (perhaps C-code) called
"band_den_bin" in the base library (used for kernel density estimators).
Is there a newer version of this function. I have an old routine using
this but it won't run in the newer version of R.
Any help is much appreciated.
Jacob
Jacob L van Wyk
Dept of Statistics
University of Johannesburg, APK Campus
Box
2006 Jul 20
3
Permutation Distribution
Hallo
Is there an elegant way to do the following:
Dataset consists of 2 variables: var1: some measurements, and var2: a grouping variable with two values, 1 and 2.
There are (say) 10 measurements from group 1 and 15 measurements from group 2.
The idea is to study the permutation distribution of mean(group 1) * mean(group2).
One way would be to permute 1s and 2s and select the corresponding
2006 Nov 10
2
Command Line Prompt Symbol
Hi
I run R in Windows.
Is there a simple way of changing the prompt symbol ">" to, say, "R>" ?
(Not just for a temporary session, but every time R command window is
opened.) The documentation of doing this is rather "sparse".
Much appreciated for your assistance.
Jacob
Jacob L van Wyk
Department of Statistics
University of Johannesburg, APK
P O Box 524
2006 Mar 13
1
Density Estimation
Hallo
I am trying to use the package LocFit to follow the example given in an
Introductory note of C Loader concerning density estimation. It involves
the "geyser" dataset (107 observations on durations, inlc in the
package).
I have tried the following (using the latest version of R):
fit.of <- locfit(~geyser,flim=c(1,6),alpha=c(0.15,0.9))
plot(fit.of,get.data=T,mpv=200)
This
2008 Jul 19
3
R version 2.7.1 (warnings)
Hi
I have installed the new version 2.7.1, and get the following messages. Is there some way I can "fix it" ?
I use SciViews as well, so the problem may be with one of the libraries that is loaded at start-up:
Start-up:
Loading required package: datasets
Loading required package: utils
Loading required package: grDevices
Loading required package: graphics
Loading required package:
2010 Feb 09
1
Installation require proxy settings (continued)
Thanks to Greg and Michael for their advice.
I have tried all these possibilities (and other); nothing seems to work; I persistently get the message:
In open.connection(con, "r") :
cannot open: HTTP status was '407 Proxy Authentication Required'
It seems as if "proxy authentication required" is causing the problem.
It seems I have to set up an .Renviron file, but I am
2010 Feb 08
1
R installation require proxy setting
Could somebody please assist with the problem I have now.
At our university certain changes have been made to users regarding accessing the internet.
I have re-installed the (current) version of R, using custom settings (for Windows XP), choosing amongst other things "Internet2" somewhere.
Now, when I wish to install new packages, I first have to select a CRAN mirror.
R gives me a list
2010 Jun 10
1
Help with Tinn-R
I have just installed the latest versions of R and Tinn-R (running Windows XP prof.)
R 2.11.0
Tinn-R version 2.3.5.2
Everything seems fine, except for the following:
I usually do this: Open Tinn-R and click on the R icon to open R - this splits the screen into two parts horiozontally, with Tinn-R on top and R in the bottom window.
My problem is simply this:
By highlighting one line, and click the
2009 Jun 12
1
Studentized intervals
I am trying to find studentized bootstrap intervals for the skewness of a data set. I have tried the following (nerve.dat is a set of data containing observations on one variable) (using Windows XP):
x <- scan("e:/Flashbackup2009/Nonparametrics/nerve.dat")
n <- length(x)
library(e1071)
skewness(x)
library(boot)
sampleskew <- function(x,d) {return(skewness(x[d]))}
bb <-
2006 Mar 30
2
Plotting a segmented function
This might be a trivial question, but I would appreciate if anybody
could suggest an elegant way of plotting a function such as the
following (a simple distribution function):
F(x) = 0 if x<=0
=(x^2)/2 if 0<x<=1
=2x-((x^2)/2)-1 if 1<x<=2
=1 if x>2
This is just an example. In this case it is a continuous function. But
how to do it in general in an elegant way.
2006 Sep 22
2
A simple resampling problem
Dear UseRs
I would like to show my students how to use "resampling" to solve the
following simple problem:
If a family has two children of which one is a boy, what is the
probability that the other child is also a boy.
The answer is (obviously) 1/3, and can be show easily using the usual
methods.
But I would like to get the students to think of resampling, by doing
the following:
2010 Feb 10
1
Installation require proxy settings (2)
Hi
Thanks again to Greg, and Prof Ripley.
Greg, I was trying to send you an email, but has been unsuccessful.
Speaking to someone from our IT deparment, I am trying to follow your advice to implement the settings to my computer (using Windows), by using Control Panel.
I have selected System in Control Panel and chose System, Advanced tab, Environmental Variables, and created the user variables: