Displaying 20 results from an estimated 1500 matches similar to: "p-level in packages mgcv and gam"
2006 Dec 27
1
Question about predict function
I am working with a non-parametic smoothing operation using a
Generalized Additive Model. It is a bivariate data set. I know how to
do the smooth, and out comes a nice smooth curve.
Now I want to find the value of the smoothed curve for several values
of x (the abscissa). This can be done (please correct me if I am
wrong) by using the predict.gam function. You feed the predict.gam
function a
2011 Nov 29
1
Calculating the probability for a logistic regression
Hi All,
When we run the command : summary ( newmod<-gam(Dlq~ formula,family,,data) )
in R, the output would the effect of smoothness in R.
As of now to calculate the probability I am following the below approach:
1) Run the plot of the GAM , interpret the curves
2) Re Run the Regression as a GLM after taking into account the non linear
terms in step1
3) Calculate the probability from
2006 Feb 13
2
transforming data frame for use with persp
Hi,
This is probably documented, but I cannot find the right words or
expression for a search. My attempts failed.
I have a data frame of 3 vectors (x, y and z) and would like to
transform this so that I could use persp. Presently I have y-level
copies of each x level, and a z value for each x-y pair. I need 2
columns giving the possible levels of x and y, and then a
transformation of
2005 Oct 05
3
testing non-linear component in mgcv:gam
Hi,
I need further help with my GAMs. Most models I test are very
obviously non-linear. Yet, to be on the safe side, I report the
significance of the smooth (default output of mgcv's summary.gam) and
confirm it deviates significantly from linearity.
I do the latter by fitting a second model where the same predictor is
entered without the s(), and then use anova.gam to compare the
2011 Oct 08
1
Generalized Additive Models: How to create publication-ready regression tables
Hi -
I have a series of 9 GAM regressions with about 5 parametric effects and
three non-parametric effects in each.
What is a good library or command for turning GAM outputs into
publication-ready regression tables?
I tried apsrtable and the mtable command in memisc but neither seemed to
work with the gam output.
I'd be okay with two separate tables - one for the parametric effects and
2007 Aug 17
2
for plots
Hi, All,
I am a beginner for R. Now I have installed R 2.5.1 in Window
environment. After I run a program such as "gam" I would like to display
a plot for the object. The following is an example. When I did this,
only the last plot was presented on my screen. How can I get a plot
before the last plot? I mean if the object has several plots how can I
get those?
"gam.object <-
2006 Mar 05
1
predicted values in mgcv gam
Hi,
In fitting GAMs to assess environmental preferences, I use the part
of the fit where the lower confidence interval is above zero as my
criterion for positive association between the environmental variable
and species abundance. However I like to plot this on the original
scale of species abundance. To do so I extract the fit and SE using
predict.gam.
Lately I compared more
2011 May 12
1
Saving misclassified records into dataframe within a loop
Greetings R world,
I know some version of the this question has been asked before, but i need
to save the output of a loop into a data frame to eventually be written to a
postgres data base with dbWriteTable. Some background. I have developed
classifications models to help identify problem accounts. The logic is this,
if the model classifies the record as including variable X and it turns out
2011 Jan 26
2
Extracting the terms from an rpart object
Hello all,
I wish to extract the terms from an rpart object.
Specifically, I would like to be able to know what is the response variable
(so I could do some manipulation on it).
But in general, such a method for rpart will also need to handle a "." case
(see fit2)
Here are two simple examples:
fit1 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
fit1$call
fit2 <-
2011 Apr 22
3
Parametrized object name in Save statement
Greetings All,
I am looking to write a parametrized Rscript that will accept a variable
name(that also is the name of the flat file), transform the data into a data
frame and preform various modeling on the structure and save the output and
plot of the model. In this example i am using a rpart decision tree. The
only problem i am having is integrating the parameter into the internal
object name
2005 Jan 06
6
"labels" attached to variable names
Hi,
Can we attach a more descriptive "label" (I may use the wrong
terminology, which would explain why I found nothing on the FAQ) to
variable names, and later have an easy way to switch to these labels in
plots? I fear this is not possible and one must enter this by hand as
ylab and xlab when making plots.
Thanks in advance,
Denis Chabot
2007 Jun 15
2
model.frame: how does one use it?
Philipp Benner reported a Debian bug report against r-cran-rpart aka rpart.
In short, the issue has to do with how rpart evaluates a formula and
supporting arguments, in particular 'weights'.
A simple contrived example is
-----------------------------------------------------------------------------
library(rpart)
## using data from help(rpart), set up simple example
myformula <-
2002 Apr 29
2
RPart
I am using the rpart package and seem to have trouble with data sets that
have columns with no data. I look at the column data in R and all values are
NA. When this occurs, I get nothing back from the rpart function. Is there a
way to get the rpart package to ignore these columns, without knowing what
columns are empty? I have tried the na.action=na.omit and
na.action=na.exclude, but neither one
2003 May 24
1
...listable functions...
Hi R-helpers.
I have the following problem:
I would like to apply my function gain(df,X,A) to a
list of arguments.
df is a data frame
X,A are the varibales od data frame.
When I do
> gain(kyphosis,"Kyphosis",c("Start","Number"))
[1] "Start" "Number"
I get the following error...
Error in unique.default(x) : unique() applies only to
vectors
I
2010 Dec 13
2
rpart.object help
Hi,
Suppose i have generated an object using the following :
fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
And when i print fit, i get the following :
n= 81
node), split, n, loss, yval, (yprob)
* denotes terminal node
1) root 81 17 absent (0.7901235 0.2098765)
2) Start>=8.5 62 6 absent (0.9032258 0.0967742)
4) Start>=14.5 29 0 absent (1.0000000
2012 Mar 04
1
rpart package, text function, and round of class counts
I run the following code:
library(rpart)
data(kyphosis)
fit <- rpart(Kyphosis ~ ., data=kyphosis)
plot(fit)
text(fit, use.n=TRUE)
The text labels represent the count of each class at the leaf node.
Unfortunately, the numbers are rounded and in scientific notation rather
than the exact number of examples sorted by that node in each class.
The plot is supposed to look like
2005 Feb 04
5
2 small problems: integer division and the nature of NA
Hi,
I'm wondering why
48 %/% 2 gives 24
but
4.8 %/% 0.2 gives 23...
I'm not trying to round up here, but to find out how many times
something fits into something else, and the answer should have been the
same for both examples, no?
On a different topic, I like the behavior of NAs better in R than in
SAS (at least they are not considered the smallest value for a
variable), but at the
2009 Dec 14
1
RPART - printing full splitting rule number on tree plot
Dear R-users
I am using RPART package to get regression trees. However having trouble getting the text function to put the full splitting rule number on the plot, instead to puts it in scientific notation. When a covariate has 1e4 or greater number of digits then the splitting rule number displayed on the plot is in scientific notation. But print.rpart displays the splitting rules in full.
2007 Mar 18
2
italics letter in roman string
Hi,
As part of the legend to a plot, I need to have the "n" in italics
because it is a requirement of the journal I aim to publish in:
"This study, n = 3293"
Presently I have:
legend(20, 105, "This study, n = 3293", pch=1, col=rgb(0,0,0,0.5),
pt.cex=0.3, cex=0.8, bty="n")
I suppose I could leave a blank in place of the "n",
2006 Mar 18
2
legend in bubble plots made with symbols()
Hi,
I have read about the use of symbols() to draw circles of different
sizes, but I have not been able to find out how to add a legend to
such a graph, legend that would display some specific sizes and their
meaning.
Before finding the symbols function in Paul Murrell's book, I had
rolled by own function where the variable I want to use to control
circle size was actually used to