Displaying 20 results from an estimated 11000 matches similar to: "strange `nls' behaviour"
2007 Nov 06
0
strange `nls' behaviour
dear list,
I stumbled over the follwing strange behaviour/error when
using `nls' which I'm tempted (despite the implied "dangers")
to call a bug:
I've written a driver for `nls' which allows specifying the
model and the data vectors using arbitrary symbols.
these are internally mapped to consistent names, which
poses a slight complication when using `deriv' to
2004 Jun 01
1
swapping with data.frame
Hi there,
I have some data which are convenient to enter as lists. For example:
t1<-list(fname="animal1",testname="hyla",dspkr="left",res1=39.7,res2=15.0)
t2<-list(fname="animal1",testname="bufo",dspkr="left",res1=14.4,res2=56.1)
2012 Jan 04
1
function in R for my exercise
Hi R helpers!
I have a question. I'm trying to create a function for an exercise. Here are
the arguments I should include:
x and y are numeric
z is a name ("plus","minus","multiply","divide")
and swap is logical.
Here is what the function should do:
When z="plus", then x+y is performed and so on for the other z names. It
should give a NA
2007 Nov 13
1
`eval' and environment question
my understanding of `eval' behaviour is obviously
incomplete.
my question: usually `eval(expr)' and `eval(expr,
envir=parent.frame())' should be identical. why does the
last `eval' (yielding `r3') in this code _not_ evaluate in
the local environment of function `f' but rather in the
global environment (if `f' is called from there)?
2006 Aug 18
1
multivariate analysis by using lme
Dear R users,
I have a data structure as follows:
id two res1 res2 c1 c2 inter
1 -0.786093166 1 0 1 2 6
3 -0.308495749 1 0 0 1 2
5 -0.738033048 1 0 0 0 1
7 -0.52176252 1 0
2000 Jul 05
1
Tukey.aov with split-plot designs
I am using R 1.1 with Redhat 6.2 and RW 1.001 with Win98 (the upkey doesn't
work on my IBM either as has been previously reported by others).
The function aov doesn't return either the residuals or the residual
degrees of freedom for split-plot designs.
If you use the following code from Baron and Li's "Notes on the use of R
for psycology experiments and questionnaires"
2013 Apr 29
1
how to add new rows in a dataframe?
Hi,
dat1<- read.table(text="
id??????????????? t???????????????????? scores
2???????????????? 0??????????????????????? 1.2
2???????????????? 2???????????????????????? 2.3
2???????????????? 3??????????????????????? 3.6
2???????????????? 4??????????????????????? 5.6
2???????????????? 6??????????????????????? 7.8
3???????????????? 0??????????????????????? 1.6
3????????????????
2010 Jul 20
1
p-values pvclust maximum distance measure
Hi,
I am new to clustering and was wondering why pvclust using "maximum"
as distance measure nearly always results in p-values above 95%.
I wrote an example programme which demonstrates this effect. I
uploaded a PDF showing the results
Here is the code which produces the PDF file:
-------------------------------------------------------------------------------------
s <-
2007 Sep 25
0
non-linear fitting (nls) and confidence limits
dear list members,
my question concerns computation of confidence intervals in nonlinear
fits with `nls' when weigthing the fit. the seemingly correct procedure
does not work as (I) expected. I'm posting this here since: (A) the
problem might suggest a modification to the `m' component in the return
argument of `nls' (making this post formally OK for this list) and (B) I
got no
2011 Apr 12
1
question about optim
Dear R-users,
I would like to use optim( ) to minimize a function which depends on 4 parameters: 2 vectors, a scalar, and a matrix.
And I have a hard to define the parameters at the beginning of the function, and then to call optim. Indeed, all the examples I have seen dont treat cases where parameters are not all real.
Here is my code, it doesnt work but its just to show you where is exactly my
2003 Aug 21
4
anova(lme object)
Hi,
I use lme to fit models like
R> res1 <- lme(y~A+B, data=mydata, random=~1|subject)
R> res2 <- lme(y~B+A, data=mydata, random=~1|subject)
(only difference between these two models are the
sequence in which the indep variables are written in
formula)
where y is continuous and A, B, and subject are
factors. To get ANOVA table I used
R> anova(res1)
R> anova(res2)
and found
2011 May 19
3
problem with optim()
Dear R-users,
I would like to maximize the function g above which depends on 4 parameters (2 vectors, 1 real number, and 1 matrix) using optim() and BFGS method. Here is my code:
# fonction to maximize
g=function(x)
{
x1 = x[1:ncol(X)]
x2 = x[(ncol(X)+1)]
x3 = matrix(x[(ncol(X)+2):(ncol(X)+1+ncol(X)*ncol(Y))],nrow=ncol(X),ncol=ncol(Y))
x4 = x[(ncol(X)+1+ncol(X)*ncol(Y)+1):length(x)]
2005 Jul 19
1
initial points for arms in package HI
Dear R-users
I have a problem choosing initial points for the function arms()
in the package HI
I intend to implement a Gibbs sampler and one of my conditional
distributions is nonstandard and not logconcave.
Therefore I'd like to use arms.
But there seem to be a strong influence of the initial point
y.start. To show the effect I constructed a demonstration
example. It is reproducible
2013 Apr 14
1
possible loop problem
Hi,
It would be better if you provided the output of dput(dataset).? I am not sure about the structure of your dataset.
Just from reading the data as is shown.
dat1<- read.table(text="
separator,tissID
>,>,2
,2,1
,6,5
,11,13
>,>,4
,4,9
,6,2
,7,3
,21,1
,23,58
,25,9
,26,4
>,>,11
,1,12
>,>,21
,4,1
,11,3
2011 Aug 04
1
How to get the test statistic corresponding to the p-value in mtable?
Dear R-Users,
I want to use mtable from package "memisc" to produce Latex-style estimation
output. However, mtable() only gives me a p-value and not the corresponding
test-statistic. Does anyone know how to extract it, either from a glm/anova
object or mtable? Here is a short example:
# Run this ####################
install.packages("memisc")
library(memisc)
set.seed(1)
2004 Jun 03
5
Confidence intervals for predicted values in nls
Dear all
I have tried to estimate the confidence intervals for predicted values of a
nonlinear model fitted with nls. The function predict gives the predicted
values and the lower and upper limits of the prediction, when the class of
the object is lm or glm. When the object is derived from nls, the function
predict (or predict.nls) gives only the predicted values. The se.fit and
interval aguments
2011 Feb 24
2
MCMCpack combining chains
Deal all, as MCMClogit does not allow for the specification of several chains, I have run my model 3 times with different random number seeds and differently dispersed multivariate normal priors.
For example:
res1 = MCMClogit(y~x,b0=0,B0=0.001,data=mydat, burnin=500, mcmc=5500, seed=1234, thin=5)
res2 = MCMClogit(y~x,b0=1,B0=0.01,data=mydat, burnin=500, mcmc=5500, seed=5678, thin=5)
res3 =
2012 Aug 06
1
cannot find function "simpleRDA2"
Hi,
I am trying to run the command "forward.sel.par," however I receive
the error message: "Error: could not find function 'simpleRDA2'." I
have the vegan library loaded. The documentation on "varpart" has not
helped me to understand why I cannot call this function. Maybe I am
missing something obvious because I am still an 'R' novice.
Below is a
2007 Aug 15
3
Formula in lm inside lapply
I am trying to run separate regressions for different groups of
observations using the lapply function. It works fine when I write the
formula inside the lm() function. But I would like to pass formulae into
lm(), so I can do multiple models more easily. I got an error message
when I tried to do that. Here is my sample code:
#generating data
x1 <- rnorm(100,1)
x2 <- rnorm(100,1)
y <-
2023 Nov 14
1
data.frame weirdness
What is going on here? In the lines ending in #### the inputs and outputs
are identical yet one gives a warning and the other does not.
a1 <- `rownames<-`(anscombe[1:3, ], NULL)
a2 <- anscombe[1:3, ]
ix <- 5:8
# input arguments to #### are identical in both cases
identical(stack(a1[ix]), stack(a2[ix]))
## [1] TRUE
identical(a1[-ix], a2[-ix])
## [1] TRUE
res1 <-