similar to: 'nls' and its arguments

Displaying 20 results from an estimated 6000 matches similar to: "'nls' and its arguments"

2007 Jun 07
2
Nonlinear Regression
Hello I followed the example in page 59, chapter 11 of the 'Introduction to R' manual. I entered my own x,y data. I used the least squares. My function has 5 parameters: p[1], p[2], p[3], p[4], p[5]. I plotted the x-y data. Then I used lines(spline(xfit,yfit)) to overlay best curves on the data while changing the parameters. My question is how do I calculate the residual sum of squares.
2005 Jul 11
2
Weighted nls
Dear R Community, I am attempting to perform a weighted non-linear least squares fit. It has already been noted that the weights option is not yet implemented for the nls function, but no one seems to offer any suggestions for getting around this problem. I am still curious if a) anyone has code they have written which includes a weight options for nls, or b) if there is another model which
2004 Nov 08
2
Nonlinear weighted least squares estimation
Hi there, I'm trying to fit a growth curve to some data and need to use a weighted least squares estimator to account for heteroscedasticity in the data. A weights argument is available in nls that would appear to be appropriate for this purpose, but it is listed as 'not yet implemented'. Is there another package which could implement this procedure? Regards, Robert Brown
2004 Feb 02
1
Robust nonlinear regression - sin(x)/x?
You reall have only one parameter in your model, c = a/b. You can't identify both a and b from your model, therefore, you should fit the linear model: lm(z ~ c* sin(x)/x) Ravi. ----- Original Message ----- From: cstrato <cstrato at aon.at> Date: Monday, February 2, 2004 2:28 pm Subject: [R] Robust nonlinear regression - sin(x)/x? > Dear all > > Since I did not receive any
2009 Nov 17
1
Define lm/glm object without evaluating them
For e.g. lm/glm type models I would like to separate model specification and model fitting and then only fit the models later 'when data arrives'. To be specific, I would like make a specification like m1 <- lm(rate~conc) m2 <- lm(rate~I(conc^2)) and then later I want to 'put data into' the objects and evaluate (fit the model), e.g. something like update(m1, data=Puromycin)
2003 Oct 28
2
Confidence ellipse for correlation
Hello, SAS' point and click interface has the option of produce a scatterplot with a superimposed confidence ellipse for the correlation coefficient. Since I generally like R so much better, I would like to reproduce this in R. I've been playing with the ellipse package. In order to have the points and the ellipse on the same graph I've done the following. (Load ellipse
2011 Apr 20
1
How can I 'predict' from an nls model with a fit specified for separate groups?
Following an example on p 111 in 'Nonlinear Regression with R' by Ritz & Streibig, I have been fitting nls models using square brackets with the grouping variable inside. In their book is this example, in which 'state' is a factor indicating whether a treatment has been used or not: > Puromycin.m1 <- nls(rate ~ Vm[state] * + conc/(K[state] + conc), data = Puromycin,
2006 Nov 29
3
R2.4 xyplot + panel.number problem
Hi all; I'm trying to display a 2 panel plot for the Puromycin data from R with 2 different non-linear models fitted to each group. The problem is that as far as I know panel.number doesn't work in the latest version of R. Can anyone give a hint how to solve this? Here is the code that I used before and now doesn't work xyplot(rate ~conc| state,Puromycin,
2007 Jun 04
0
nls problems
Hi, All: The following identifies apparent inconsistencies and proposed fixes between the documentation and the behavior of 'nls'. Specifically, the help file says 'data' 'Can also be a list'. However, I got an error when I tried it with a list that could not be coerced to a data.frame. This is documented in the first example below. Also, the
2012 Mar 06
1
How to eliminate for next loops in this script
I needed to compute a complicated cross tabulation to show weighted means and standard deviations and the only method I could get that worked uses a series of nested for next loops. I know that there must be a better way to do so, but could use some assistance pointing the way. Here is my working, but inefficient script: library(Hmisc) rm(list=ls()) load('NHTS.Rdata') day.wt <-
2008 Nov 03
2
standard errors for predict.nls?
Dear all, Is there a way to retrieve standard errors from nls models? The help page tells me that arguments such as se.fit are ignored... Many thanks and best wishes Christoph -- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen Germany phone +49 (0)551 39 8807 fax +49 (0)551 39 8806 Homepage http://www.gwdg.de/~cscherb1
2004 May 21
1
Buglet/omission in nls package (PR#6901)
Dear all, I noticed the following under R 1.8.1 (when nls was still a separate package) but the same problem occurs under R 1.9.0 (where most (all?) of nls is now in the stats package): > data(Puromycin) > fm <- nls(rate~SSmicmen(conc,b0,b1), Puromycin, subset = state=="treated") > coef(summary(fm)) NULL The problem seems to be that summary.nls uses the name
2003 May 22
1
Plot observed vs. fitted values (weighted nls)
Dear WizaRds, Given the experimental data, csdata<-data.frame( time=c(0,1,3,9,20), conc=c(638.697,395.69,199.00,141.58,112.16) ) weighted nls is applied, wt.MM<- function(resp, time,A1,a1,A2,a2) { pred <- A1*exp(-a1*time)+A2*exp(-a2*time) (resp - pred) / sqrt(pred) } # cs.wt <- nls( ~ wt.MM(conc, time,A1,a1,A2,a2), data=csdata,
2005 Jul 19
2
Michaelis-menten equation
Dear R users: I encountered difficulties in michaelis-menten equation. I found that when I use right model definiens, I got wrong Km vlaue, and I got right Km value when i use wrong model definiens. The value of Vd and Vmax are correct in these two models. #-----right model definiens-------- PKindex<-data.frame(time=c(0,1,2,4,6,8,10,12,16,20,24),
2009 Nov 28
1
Plot fitted vs observed values
Dear Wiza[R]ds, # I have the following experimentally observed data: csdata <- data.frame( time=c(0,1,3,9,20), conc=c(638.697,395.69,199.00,141.58,112.16) ) # weighting resp means response wt.MM<- function(resp, time,A1,a1,A2,a2) { pred <- A1*exp(-a1*time)+A2*exp(-a2*time) (resp - pred) / sqrt(pred) } # Fit using nls cs.wt <- nls( ~ wt.MM(conc, time,A1,a1,A2,a2),
2011 Dec 04
1
Complex multiple t tests in a data frame with several id factors
I have assayed the concentrations of various metal elements in different anatomic regions of two strains of mice. Now, for each element, in each region, I want to do a t test to find whether there is any difference between the two strains. Here is what I did (using simulated data as an example): # create the data frame > elemconc = data.frame(expand.grid(id=1:3, geno=c('exp',
2003 May 21
2
Access Object's Objects HELP
Dear WizaRds, A run of nls produces the following concise summary: > summary(cs.wt) Formula: 0 ~ wt.MM(conc, time, A1, a1, A2, a2) Parameters: Estimate Std. Error t value Pr(>|t|) A1 4.814e+02 2.240e+01 21.495 0.0296 * a1 7.401e-01 7.435e-02 9.956 0.0637 . A2 1.613e+02 1.738e+01 9.280 0.0683 . a2 1.770e-02 7.324e-03 2.417 0.2497
2000 Aug 12
1
Nonlinear regression question
Dear R users I recently migrated from Statistica/SigmaPlot (Windows) to R (Linux), so please excuse if this may sound 'basic'. When running a nonlinear regression (V = Vmax * conc / (Ks + conc), i.e. Michaelis-Menten) on SigmaPlot, I get the output listed below: >>>Begin SigmaPlot Output<<< R = 0.94860969 Rsqr = 0.89986035 Adj Rsqr = 0.89458984 Standard Error of
2011 Dec 08
1
How to plot multiple graphs in one go?
I am trying to do this, but it won't work: > library(lattice) > elemconc = data.frame(expand.grid(id=1:20, geno=c('exp', 'wt'), region=c('cor', 'cr', 'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(360, 10)) > elemconc$geno = factor(elemconc$geno) > elemconc$region = factor(elemconc$region) > for (i in
2003 May 12
1
plot.ranef.lme (PR#2986)
library(nlme) data(Phenobarb) na.include <- function(x)x phe1 <- nlme(conc~phenoModel(Subject, time, dose, lCl, lV), data = Phenobarb, fixed = lCl+lV~1, random= pdDiag(lCl+lV~1), start = c(-5,0), na.action = na.include, naPattern = ~!is.na(conc)) phe.ranef <- ranef(phe1,augFrame=TRUE) plot(phe.ranef, form=lCl~Wt+ApgarInd) [Error in max(length(x0),