similar to: fit a nonlinear model using nlm()

Displaying 20 results from an estimated 400 matches similar to: "fit a nonlinear model using nlm()"

2012 Aug 31
2
Conditional merging in R & if then statement
1)I am wandering how the following SQL statement can be written in R language w/o using sqldf: create table detail2 as select a.* from detail a, pdetail b where a.TDATE=b.TDATE and (a.STIM >= b.STIM and a.STIM <=b.MAXTIM) 2) when try if then in R it only applies to the 1st row & not to whole dataset like in SAS. How do you get round that? in SAS: data summary; set all1;
2012 Dec 02
1
Repeated-measures anova with a within-subject covariate (or varying slopes random-effects?)
Dear all, I am having quite a hard time in trying to figure out how to correctly spell out a model in R (a repeated-measures anova with a within-subject covariate, I guess). Even though I have read in the posting guide that statistical advice may or may not get an answer on this list, I decided to try it anyway, hoping not to incur in somebody's ire for misusing the tool. For the sake of
2011 Feb 16
1
read.table - reading text variables as text
Hi I'm reading a CSV file using read.table, and it keeps importing a text variable as a factor. To overcome this, I've used the as.is command referring to the variable in question (called "stim") data<-read.table(file.choose(), header=T, sep=",", as.is = "stim") However, "stim" is still imported as a factor. I notice there are other read.table
2009 Dec 08
4
lower.tail option in pnorm
Hi, I would have thought that these two constructions would produce the same result but they do not. Resp <- rbinom(10, 1, 0.5) Stim <- rep(0:1, 5) mm <- model.matrix(~ Stim) Xb <- mm %*% c(0, 1) ifelse(Resp, log(pnorm(Xb)), log(1 - pnorm(Xb))) pnorm(as.vector(Xb), lower.tail = Resp, log.p = TRUE) > ifelse(Resp, log(pnorm(Xb)), log(1 - pnorm(Xb))) [1] -0.6931472 -1.8410216
2011 Feb 28
1
Creating new variables. How do you get them into a data frame?
Hi I'm an R newbie. I can't seem to add new variables to data frames. Here are the stages (1) I import the data using read.csv. (2) I fix it using fix(data) (3) I create a new variable using spos<-tagPOS(stim,language="en",model=NULL,tagdict=NULL). (tagPOS is a function in the OpenNLP toolkit, which tags a string for part of speech. "stim" is a variable in the
2013 Jun 07
1
Function nlme::lme in Ubuntu (but not Win or OS X): "Non-positive definite approximate variance-covariance"
Dear all, I am estimating a mixed-model in Ubuntu Raring (13.04¸ amd64), with the code: fm0 <- lme(rt ~ run + group * stim * cond, random=list( subj=pdSymm(~ 1 + run), subj=pdSymm(~ 0 + stim)), data=mydat1) When I check the approximate variance-covariance matrix, I get: > fm0$apVar [1] "Non-positive definite
2011 Mar 22
1
how to convert a data.frame to a list of dist objects for individual differences MDS?
I have a 45 x 16 data frame consisting of dissimilarities among 10 colors, giving in each column the 45 = 10*9/2 pairwise judgments for one of 16 subjects. The rownames identify each pair of colors, e.g, "AC" = ("A","C"), and the pairs are ordered by columns in the lower triangle of each distance matrix. > helm.raw <-
2013 Jul 20
1
how to calculate the average values of each row in a matrix
Hello, I have a matrix (class matrix) composed of GridCell (row and column). The matrix value is the beta diversity index value between two grids. Now I would like to get the average value of each GridCell. Please kindly advise how to make the calculation. Thank you. Elaine The matrix looks like (cited from Michael Friendly) I would like to get the average value of each color. Obs
2007 Nov 06
1
Problem with a non-factor, non-numeric variable in a data.frame
Dear R list, I would like to perform an ANOVA in a set of measurements, but I have problems formatting the data. The data is a two dimensional array containing two columns: - "Stim" : the type of stimulation (string) - "Ratio" : a ratio of two numeric values Now, because some values are missing in the data (defaulting to zero), part of this array will be populated with NA
2000 Oct 26
1
competing risks survival analysis
I will have data in the following form: Time resp type stim type 300 a A 200 b A 155 a B 250 b B 80 c A 1000 d B ... c is left censored observation; d is right censored This sort of problem is discussed in Chap 9 of Cox & Oakes Analysis of Survival Data under the name
2004 Aug 01
1
Preserving ACLs on files when copying from NT4 server to Samba 3.0.5 server
Hi guys. I'm running: Mandrake 9.2 Kernel 2.4.22-30mdk XFS file system Samba 3.0.5 plus patches for bugs 1315, 1319 and 1345 (self compiled) OpenLDAP 2.1.22-5mdk smbldap-tools 0.8.5 I was able to join the Samba to the NT PDC as a BDC and vampire without issue. I have setup duplicate shares on Samba and am trying to copy over the data from NT. I have tried scopy, xcopy and copying via
1998 Feb 27
1
R-beta: is there a way to get rid of loop?
Here is a programming question. The code I am using is quite slow and I was wondering if there is a way to get rid of the for loop. I am dealing with "interaction" in 2x2 table, and am using Edwards's G_I (Likelihood, p. 194). I label the cells in the table as follows stim response "y" "n" total -------------------------------- y hit miss nsignal
2010 Feb 02
1
how to use optim() or nlm() to solve three nonlinear equations
Dear all, I just know how to solve an eaquation by using optim() or nlm(). But, now, I have three nonlinear equations, how could we use optim() or nlm() to solve  a system of nonlinear equations in R?  Thank you so much. Sincerely, Joe ___________________________________________________ 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! [[alternative HTML version deleted]]
2012 Nov 15
6
Xen credit scheduler question
Hi all (and Mr. Dunlap in particular), I have a question about the credit (and ultimately credit2) scheduler that I hope you can help me with. I have read the white paper "Scheduler development update" and as much material on the credit scheduler as I can find, but I am still not completely clear on how I should think about the cap. Example scenario: Server hardware: 2
2008 Oct 26
20
Big test coming up: fallout 3
ok as everyone knows, (and to be frank i didnt think it would in my lifetime ;P) fallout 3 gets released in 3 days or 6 for those who live in europe. now for those who where playing games since the 3rd grade the fallout universe has a special place in their hearts since literally i grew with it! so in mho fallout 3 fells in the category of games that someone must simply have, and thats why im
2008 Mar 19
0
Error en nlm(logdgenexpn, p = c(vmomest[[1]], vmomest[[2]]), x = x.genexp, : valor no finito provisto por 'nlm'
Dear useRs, I am analysing the behaviour of MLE for the two parameters of a kind of exponential distribution, leaving as initial values the estimators moments produced by the variation coefficient. I do using simulations, giving them an accountant, r. But running my codes remains a problem with the nlm function. To review details wearing On one of the lines put status
2010 Jun 15
1
Error in nlm : non-finite value supplied by 'nlm'
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is the negative loglikelihood derived from a mixing operator. f=function(vector)
2010 Aug 04
5
Question regarding significance of a covariate in a coxme survival model
Hi, I am running a Cox Mixed Effects Hazard model using the library coxme. I am trying to model time to onset (age_sym1) of thought problems (e.g. hearing voices) (sym1). As I have siblings in my dataset, I have decided to account for this by including a random effect for family (famid). My covariate of interest is Mother's diagnosis where a 0 is bipolar, 1 is control, and 2 is major
2003 Oct 24
1
first value from nlm (non-finite value supplied by nlm)
Dear expeRts, first of all I'd like to thank you for the quick help on my last which() problem. Here is another one I could not tackle: I have data on an absorption measurement which I want to fit with an voigt profile: fn.1 <- function(p){ for (i1 in ilong){ ff <- f[i1] ex[i1] <- exp(S*n*L*voigt(u,v,ff,p[1],p[2],p[3])[[1]]) } sum((t-ex)^2) } out <-
2002 Dec 11
0
nlm() vs. nls()
Dear R-experts! I've been using nls() for a while for fitting my data, approx 10,000 points long. Now, I have to use low-level minimizing functions to get more control on fitting process, so I tried nlm(). And, the fitting process became *much* more slower! The question is: why? why nls() works faster? Thank you very much! Timur.