search for: fit

Displaying 20 results from an estimated 23777 matches for "fit".

Did you mean: bit
2003 Jul 08
2
NLME Fitted Values
Dear List: I am having difficulties with the fitted values at different levels of a multilevel model. My data set is a series of student test scores over time with a total of 7,280 observations, 1,720 students nested witin 60 schools. The data set is not balanced. The model was fit using eg.model.1<-lme(math~year, random=~year|schoolid/chi...
2007 Jun 13
2
Fitted Value Pareto Distribution
I would like to fit a Pareto Distribution and I am using the following codes. I thought the fitted (fit1) should be the fitted value for the data, is it correct? As the result of the "fitted" turns out to be a single value for all. fit=vglm(ycf1 ~ 1, pareto1(location=alpha), trace=TRUE, crit="c&quot...
2000 Jan 10
5
bug in glm (PR#397)
...minimal data set from my data (see below) where the following bug occurs: > glm(SKR.ein.aus ~ ., family = binomial, data = bugdata, na.action = na.omit) Error in names<-.default(*tmp*, value = ynames) : names attribute must be the same length as the vector In addition: Warning messages: 1: fitted probabilities of 0 or 1 occurred in: (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y, 2: fitted probabilities of 0 or 1 occurred in: (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y, 3: fitted probabilities of 0 or 1 occurred in: (if (is.empty.model(mt)) glm....
2009 Jul 15
2
storing lm() results and other objects in a list
...BLA,mcReg) LinearModel1.res <- residuals(linearModel1) LinearModel2.res <- residuals(linearModel2) LinearModel3.res <- residuals(linearModel3) LinearModel4.res <- residuals(linearModel4) LinearModel5.res <- residuals(linearModel5) #hmmm bolt on linearModel[x] as linearModel[x]$arma.fit? arma1.fit <- auto.arima(LinearModel1.res) arma2.fit <- auto.arima(LinearModel2.res) arma3.fit <- auto.arima(LinearModel3.res) arma4.fit <- auto.arima(LinearModel4.res) arma5.fit <- auto.arima(LinearModel5.res,stepwise=T,trace=T) #Ok what is left over after Regression and ARIMA that...
2000 Jan 13
0
problems with understanding behaviour of glm
Dear R users, I don't understand, what happens in glm in the following example (note that in S-Plus this example finishes with an almost perfect fit, but also 49 warnings): > fit.small <- glm(SKR.ein.aus ~ ., family = binomial, data = daten, maxit=100) Error in (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y, : inner loop 2; can't correct step size In addition: Warning messages: 1: fitted probabilities of 0 or 1 oc...
2009 Jun 22
1
Problem with storing a sequence of lmer() model fit into a list
Dear R-helpers: May I ask a question related to storing a number of lmer model fit into a list. Basically, I have a for-loop (see towards the bottom of this email) in the loop, I am very sure that the i-th model fit (i.e.,fit_i) is successfully generated and the character string (i.e., tmp_i) is created correctly. The problem stems from the following line in the for-loop #troubl...
2007 Aug 02
1
simulate() and glm fits
Dear All, I have been trying to simulate data from a fitted glm using the simulate() function (version details at the bottom). This works for lm() fits and even for lmer() fits (in lme4). However, for glm() fits its output does not make sense to me -- am I missing something or is this a bug? Consider the following count data, modelled as gaussian, po...
2004 Jan 29
2
Calculating/understanding variance-covariance matrix of logistic regression (lrm $var)
Hallo! I want to understand / recalculate what is done to get the CI of the logistic regression evaluated with lrm. As far as I came back, my problem is the variance-covariance matrix fit$var of the fit (fit<-lrm(...), fit$var). Here what I found and where I stucked: ----------------- library(Design) # data D<-c(rep("a", 20), rep("b", 20)) V<-0.25*(1:40) V[1]<-25 V[40]<-15 data<-data.frame(D, V) d<-datadist(data) options(datadist="d&quo...
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
Dear R-help, Here's a simple example of nonlinear curve fitting where nls seems to get the answer wrong on a very simple exponential fit (my R version 2.7.2). Look at this code below for a very basic curve fit using nls to fit to (a) a logarithmic and (b) an exponential curve. I did the fits using self-start functions and I compared the results with a more...
2011 Sep 20
1
Data
Hey everybody, i am using the rugarch-package and its great! I have a pretty easy problem, but i just dont get it, so thanks if you can help me. Normally i use: / data(DATANAME) spec = ugarchspec() fit = ugarchfit(data = x[,1], spec = spec) fit slotNames(fit) names(fit at fit) coef(fit) infocriteria(fit) likelihood(fit) nyblom(fit) signbias(fit) head(as.data.frame(fit)) head(sigma(fit)) head(residuals(fit)) head(fitted(fit)) gof(fit,c(20,30,40,50)) uncmean(fit) uncvariance(fit) plot(fit,which=&...
2014 Jan 13
1
predict.glm line 28. Please explain
...changing that in object would have any effect on calculations done elsewhere. pj Here's the context from predict.glm, to save you trouble of looking it up: predict.glm <- function(object, newdata = NULL, type = c("link", "response", "terms"), se.fit = FALSE, dispersion = NULL, terms = NULL, na.action = na.pass, ...) { ## 1998/06/23 KH: predict.lm() now merged with the version in lm.R type <- match.arg(type) na.act <- object$na.action object$na.action <- NULL # kill this for predict.lm calls if (!se.fit...
2008 May 06
1
question about se of predicted glm values
Hey, all. I had a quick question about fitting new glm values and then looking at the error around them. I'm working with a glm using a Gamma distribution and a log link with two types of treatments. However, when I then look at the predicted values for each category, I find for the one that is close to 0, the error (using se....
2000 Jan 05
0
bug in glm.fit (PR#395)
Dear R-team There seems to be a bug in glm.fit - I got the following error message: > > > + Error in names<-.default(*tmp*, value = ynames) : names attribute must be the same length as the vector In addition: Warning messages: 1: fitted probabilities of 0 or 1 occurred in: (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X,...
2010 Mar 17
1
Reg GARCH+ARIMA
Hi, Although my doubt is pretty,as i m not from stats background i am not sure how to proceed on this. Currently i am doing a forecasting.I used ARIMA to forecast and time series was volatile i used garchFit for residuals. How to use the output of Garch to correct the forecasted values from ARIMA. Here is my code: ###delta is the data fit<-arima(delta,order=c(2,,0,1)) fit.res <- resid(fit) ##Check for Residuals acf((fit.res-mean(fit.res))/sd(fit.res)) acf(((fit.res-mean(fit.res))/sd(fit.res))...
2013 Sep 30
1
predictions in nlme without fixed covariantes
...est regards, Thierry Onkelinx library(nlme) data(Orthodont) m0 <- lme(distance ~ Sex, random = ~1|Subject, data = Orthodont) m1 <- lme(distance ~ 1, random = ~1|Subject, data = Orthodont) m2 <- lme(distance ~ 0, random = ~1|Subject, data = Orthodont) test.data <- Orthodont test.data$Fitted <- predict(m0, level = 0) test.data$Fitted.Newdata <- predict(m0, level = 0, newdata = test.data) sum(abs(test.data$Fitted - test.data$Fitted.Newdata)) test.data$Fitted <- predict(m0, level = 1) test.data$Fitted.Newdata <- predict(m0, level = 1, newdata = test.data) sum(abs(test.dat...
2008 Nov 06
1
nls: Fitting two models at once?
Hello, I'm still a newbie user and struggling to automate some analyses from SigmaPlot using R. R is a great help for me so far! But the following problem makes me go nuts. I have two spectra, both have to be fitted to reference data. Problem: the both spectra are connected in some way: the stoichiometry of coefficients "cytf.v"/"cytb.v" is 1/2. {{In the SigmaPlot workflow one has to copy the two spectra into one column beneath each other and the two spectra are somehow treated as one c...
2007 Aug 28
3
Forcing coefficients in lm object
Dear all, I would like to use predict.lm() with an existing lm object but with new arbitrary coefficients. I modify 'fit$coef' (see example below) "by hand" but the actual model in 'fit' used for prediction does not seem to be altered (although fit$coef is!). Can anyone please help me do this properly? Thanks in advance, J?r?mie > dat <- data.frame(y=c(0,25,32,15), x=as.factor(c(1,1,...
2005 Apr 13
3
A suggestion for predict function(s)
...the predictor variables. It just (unless there are problems) requires an extra line. I have inserted an example below. "predict.glm" <- function (object, newdata = NULL, type = c("link", "response", "terms"), se.fit = FALSE, dispersion = NULL, terms = NULL, na.action = na.pass, ...) { type <- match.arg(type) na.act <- object$na.action object$na.action <- NULL if (!se.fit) { if (missing(newdata)) { pred <- switch(type, link = object$linear.predictors,...
2006 Jul 11
3
least square fit with non-negativity constraints for absorption spectra fitting
I would really appreciate it if someone can give suggestions on how to do spectra fitting in R using ordinary least square fitting and non-negativity constraints. The lm() function works well for ordinary least square fitting, but how to specify non-negativity constraints? It wouldn't make sense if the fitting coefficients coming out as negative in absorption spectra deconvoluti...
2006 Sep 01
2
Lattice plot with fitted curves
I have some data which consists of time series for a number of sites. It appears that there is not much autocorrelation in the data and I have fitted a cubic for each site using lm. I would like to obtain a lattice plot with one panel for each site and showing the original data, and the fitted cubic. The closest I have got to doing what I want is: fit <- fitted(paraslm1) temp <- cbind(paras, fit) xyplot(Density ~ Year | LocCode, dat...