search for: fitted

Displaying 20 results from an estimated 23679 matches for "fitted".

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/childi...
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") fitted(fit) The result is fitted(fit) [,1] [1,] 0.07752694 [...
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.fit...
2009 Jul 15
2
storing lm() results and other objects in a list
to clean up some code I would like to make a list of arbitrary length to store?various objects for use in a loop sample code: ############ BEGIN SAMPLE ############## # You can see the need for a loop already linearModel1=lm(modelSource ~ .,mcReg) linearModel2=step(linearModel1) linearModel3=lm(modelSource ~ .-1,mcReg) linearModel4=step(linearModel3) #custom linearModel5=lm(modelSource ~ .
2000 Jan 13
0
problems with understanding behaviour of glm
...nishes 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 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.fit...
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 #trouble making line
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, poiss...
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
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 simple fit using a straight lm()
2011 Sep 20
1
Data
...nks 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="all")/ I want to use my data now. I figured out how to load excel sheets. setwd("C:/Users/UserofComputer/Desktop") data <- read.csv2("Dataname.csv",header=T) attach(data) x <- CGE[2...
2014 Jan 13
1
predict.glm line 28. Please explain
...match.arg(type) na.act <- object$na.action object$na.action <- NULL # kill this for predict.lm calls if (!se.fit) { ## No standard errors if(missing(newdata)) { pred <- switch(type, link = object$linear.predictors, response = object$fitted.values, terms = predict.lm(object, se.fit = se.fit, scale = 1, type = "terms", terms = terms) ) if(!is.null(na.act)) pred <- napredict(na.act, pred) } else { pred <- predict...
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.fit=T with predicted) actually makes it overlap 0.
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, 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.fit...
2010 Mar 17
1
Reg GARCH+ARIMA
...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))^2) fit.fore = predict(fit, n.ahead=test) ##Use ARIMA GARCH To fit residuals from ARIMA Model 1. fitted.gar<-garchFit(formula =~arma(2,1)+garch(1,1),data=*fit.res*,cond.dist = "std",trace=FALSE) sresi=fitted.gar@residuals/fitted.gar@sigma.t ###Standardised Residuals acf(sresi) acf(sresi^2) fore.res<-predict(fitted.ga, n.ahead=test) OR 2. fitted.gar<-garchFit(formula =~arma(2,1)+...
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.data$F...
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 curv...
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 <-
2005 Apr 13
3
A suggestion for predict function(s)
...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, response = object$fitted, terms = predict.lm(object, se.fit = se.fit, scale = 1, type = "terms", terms = terms)) if (!is.null(na.act)) pred <- napredict(na.act, pred) } else { p...
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 deconvolution. Thanks.
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, data =...