Displaying 20 results from an estimated 120 matches similar to: "curve fitting problem"
2006 Apr 01
1
Nested error structure in nonlinear model
I am trying to fit a nonlinear regression model to data. There are
several predictor variables and 8 parameters. I will write the model as
Y ~ Yhat(theta1,...,theta8)
OK, I can do this using nls() - but "only just" as there are not as many
observations as might be desired.
Now the problem is that we have a factor "Site" and I want to include a
corresponding error
2010 Apr 13
2
Generating model formulas for all k-way terms
For the vcdExtra package, I'm exploring methods to generate and fit
collections of glm models,
and handling lists of such model objects, of class "glmlist". The
simplest example is fitting all
k-way models, from k=0 (null model) to the model with the highest-order
interaction. I'm
having trouble writing a function, Kway (below) to do what is done in
the example below
>
2008 Jan 27
2
maptools no such file
Hello,
I'm having problems reading a shapefile with read.shape (maptools). I'm absolutely sure my file is there, but I get "no such file". The wd is ok, since read.table for example does find the file.
> getwd()
[1] "D:/somedirectory/R scripts"
> read.table("cities.shp")
Error in read.table("cities.shp") : empty beginning of file
In addition:
2013 Nov 25
4
lmer specification for random effects: contradictory reults
Hi All,
I was wondering if someone could help me to solve this issue with lmer.
In order to understand the best mixed effects model to fit my data, I
compared the following options according to the procedures specified in many
papers (i.e. Baayen
<http://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDsQFjAA
2007 Jan 17
1
Coefficient of determination when intercept is zero
I am curious as to the "lm" calculation of R2 (multiple coefficient of
determination, I assume) when intercept is zero. I have 18 data points, two
independent variables:
First, a model with an intercept:
> mod0=lm(Div~Rain+Evap,data=test)
> summary(mod0)$r.squared
[1] 0.6257541
> cor(predict(mod0),test$Div)^2
[1] 0.6257541
The $r.squared and the result from "cor"
2007 Aug 18
1
number precision
Hi,
I'm trying to find a way to determine how many digits a number has. I tried using nchar(paste(number)), but unfortunately paste will reduce 8.00 to "8".
Any thoughts?
Pieter
--
This message was sent on behalf of pieterprovoost at gmail.com at openSubscriber.com
http://www.opensubscriber.com/messages/r-help at stat.math.ethz.ch/topic.html
2007 Nov 20
2
barplot problem
Hello,
I'm trying to find out how I can move the y axis label of a horizontal barplot further away from the axis, in order to avoid overlap between the names (which I have rotated using las=1) and the label. I have been fiddling with the graphical parameters but nothing seems to work. Maybe a graphical representation of the graphical parameters would be helpful (cf the CSS box model).
2012 Jan 10
1
importing S3 methods with importFrom
In my own package, I want to use the default S3 method of the generic
function lrtest() from the lmtest package. Since I need only one
function from lmtest, I tried to use importFrom in my NAMESPACE:
importFrom(lmtest, lrtest)
However, this fails R CMD check in the examples:
Error in UseMethod("lrtest") :
no applicable method for 'lrtest' applied to an object of class
2006 Sep 19
2
bubble plot problems
Hi,
I'm having some problems with a bubble plot (ps package). I don't want
tick marks on all four sides (just two), I want to have a smaller font
size, and I would like to be able to define bubble sizes shown in the
legend (now it shows 0, 0, 0, 9.747 and 4265.757 which is not really
convenient. Passing some of the standard plot arguments didn't help (in
fact, nothing changed).
2010 Feb 28
1
trend test for frequencies
Hi,
which test do I have to use if I want to test if the following data follow a monotone trend;
0min 5min 10min 20min 30min
5 20 55 70 90
... where the dependent variable contains frequencies.
And how is that implemented in R?
thanks for any help (on this more statistical-question ...).
2011 Jan 06
4
Different LLRs on multinomial logit models in R and SPSS
Hello, after calculating a multinomial logit regression on my data, I
compared the output to an output retrieved with SPSS 18 (Mac). The
coefficients appear to be the same, but the logLik (and therefore fit)
values differ widely. Why?
The regression in R:
set.seed(1234)
df <- data.frame(
"y"=factor(sample(LETTERS[1:3], 143, repl=T, prob=c(4, 1, 10))),
"a"=sample(1:5,
2006 Jan 10
2
Obtaining the adjusted r-square given the regression coefficients
Hi people,
I want to obtain the adjusted r-square given a set of coefficients (without the intercept), and I don't know if there is a function that does it. Exist????????????????
I know that if you make a linear regression, you enter the dataset and have in "summary" the adjusted r-square. But this is calculated using the coefficients that R obtained,and I want other coefficients
2010 Sep 08
4
coxph and ordinal variables?
Dear R-help members,
Apologies - I am posting on behalf of a colleague, who is a little puzzled
as STATA and R seem to be yielding different survival estimates for the same
dataset when treating a variable as ordinal. Ordered() is used to represent
an ordinal variable) I understand that R's coxph (by default) uses the Efron
approximation, whereas STATA uses (by default) the Breslow. but we
2009 Aug 13
2
glm.nb versus glm estimation of theta.
Hello,
I have a question regarding estimation of the dispersion parameter (theta)
for generalized linear models with the negative binomial error structure. As
I understand, there are two main methods to fit glm's using the nb error
structure in R: glm.nb() or glm() with the negative.binomial(theta) family.
Both functions are implemented through the MASS library. Fitting the model
using these
2013 Sep 12
6
declaring package dependencies
I received the following email note re: the vcdExtra package
> A vcd update has shown that packages TIMP and vcdExtra are not
> declaring their dependence on colorspace/MASS: see
>
> http://cran.r-project.org/web/checks/check_results_vcdExtra.html
But, I can't see what to do to avoid this, nor understand what has
changed in R devel.
Sure enough, CRAN now reports errors in
2008 Jul 01
2
how to automatically maximize the graph window (under XP) ?
Hello,
I'm trying to produce graphs automatically from data stored in database.
Before saving the graphs, I would like to maximize the size of the graphs.
The best would be to directly open maximized windows with x11() but up to
now I failed doing it.
I tried different widths and heighs but I never managed to obtain a full
screen window.
Is there a command to do it ?
Thanks in advance,
Ptit
2013 Nov 25
0
R: lmer specification for random effects: contradictory reults
Dear Thierry,
thank you for the quick reply.
I have only one question about the approach you proposed.
As you suggested, imagine that the model we end up after the model selection
procedure is:
mod2.1 <- lmer(dT_purs ~ T + Z + (1 +T+Z| subject), data =x, REML= FALSE)
According to the common procedures specified in many manuals and recent
papers, if I want to compute the p_values relative to
2010 Mar 01
0
MASS::loglm - exploring a collection of models with add1, drop1
I'd like to fit and explore a collection of hierarchical loglinear
models that might
range from the independence model,
~ 1 + 2 + 3 + 4
to the saturated model,
~ 1 * 2 * 3 * 4
I can use add1 starting with a baseline model or drop1 starting with the
saturated model,
but I can't see how to get the model formulas or terms in each model as
a *list* that I can work with
further.
Consider
2007 Sep 19
1
lmer using quasibinomial family
Dear all, I try to consider overdispersion in a lmer model. But using
family=quasibinomial rather than family=binomial seems to change the fit but
not the result of an anova test. In addition if we specify test="F" as it is
recomanded for glm using quasibinomial, the test remains a Chisq test. Are
all tests scaled for dispersion, or none? Why is there a difference between
glm and lmer
2005 May 05
0
some pairs() questions
> From: Pieter Provoost
>
> I'm sure it's possible to display the variable names by making a small
> change to the code. Someone did this last week but I can't
> contact this
> person now to ask how. I tried this
>
> vars <- names(Rdata)
> pairs(Rdata, labels=vars,...)
>
> but that doesn't work (formal argument "labels" matched by