Displaying 20 results from an estimated 20000 matches similar to: "glm error message when using family Gamma(link=inverse)"
2008 Dec 09
1
glm error message when using family Gamma(link="inverse")
R 2.5
windows XP
I am getting an error from glm() that I don't understand. Any help or suggestions would be appreciated. N.B. 1<=AAMTCAREJ<=327900
> summary(data$AAMTCAREJ)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.0 404.3 1430.0 6567.0 5457.0 327900.0
> fitglm<-glm(AAMTCAREJ~sexcat+H_AGE+SmokeCat+InsuranceCat+MedicadeCat+
+
2012 Oct 04
2
Help with R Fitting an inverse Gamma
Dear all,
I am new in R and would like to ask for someone's help in understanding
where I go wrong with the following code:
rm(list=ls())
# Required packages
library(MCMCpack)
# Simulated data
set.seed(1)
data = rinvgamma(n=250, shape = 5, scale = 2) + 2
hist(data)
# log-likelihood
ll = function(par){
if(par[1]>0 & par[2]>0 & par[3]<min(data)) return(
2018 Jun 17
1
aic() component in GLM-family objects
FWIW p. 206 of the White Book gives the following for
names(binomial()): family, names, link, inverse, deriv, initialize,
variance, deviance, weight.
So $aic wasn't there In The Beginning. I haven't done any more
archaeology to try to figure out when/by whom it was first introduced
...
Section 6.3.3, on extending families, doesn't give any other relevant info.
A patch for
2007 Jun 16
1
GLM dist Gamma-links identity and inverse
Dear users;
I am doing GLMs with the Gamma distribution, and I always get errors ("no valid set of coefficients: please supply starting values") or warnings ("NaNs produced in log(x)") when I use the links identity or inverse, but I donĀ“t get them if I use the log link.
For example:
>
2012 Sep 25
1
appropriate test in glm when the family is Gamma
Dear R users,
Which test is most appropriate in glm when the family is Gamma?
In the help page of anova.glm, I found the following
?For models with known dispersion (e.g., binomial and Poisson fits) the chi-squared test is most appropriate, and for those with dispersion estimated by moments (e.g., gaussian, quasibinomial and quasipoisson fits) the F test is most appropriate.?
My questions :
2005 Jun 14
1
New Family object for GLM models...
Dear R-Users,
I wish to create a new family object based on the Binomial family. The only difference will be with the link function. Thus instead if using the 'logit(u)' link function, i plan to use '-log(i-u)'.
So far, i have tried to write the function following that of the Binomial and Negative Binomial families.
The major problem i have here is with the definition of the
2003 Jun 04
1
standard errors from glm (PR#3180)
In the iterative weighted least squares loop of the glm.fit function,
a QR decomposition of the matrix X*sqrt(w) is obtained at each iteration,
using fitted values of the mean response mu from the previous interation.
Here "X" is the design matrix, w = wt*(d(mu)/d(eta))/variance(mu),
"wt" is the vector of weights, and "d(mu)/d(eta)" is the derivative
of mu wrt the
2018 Jun 19
0
aic() component in GLM-family objects
In R, family has aic component since version 0.62. There is no aic component in family in R 0.61.3.
Looking at blame, https://github.com/wch/r-source/blame/tags/R-0-62/src/library/base/R/family.R , aic component in family is introduced in svn revision 640 (https://github.com/wch/r-source/commit/ac666741679b50bb1dfb5ce631717b375119f6ab):
using aic(.) [Jim Lindsey]; use switch() rather than many if
2005 Aug 12
1
Help converting a function from S-Plus to R: family$weight
Hi all
I am converting an S-Plus function into R. The S-Plus code
uses some of the glm families, and family objects.
The family objects in S-Plus and R have many different
features, for example:
In R:
> names(Gamma())
[1] "family" "link" "linkfun" "linkinv" "variance"
[6] "dev.resids" "aic"
2011 Jan 07
0
Fitting an Inverse Gamma Distribution to Survey Data
Hello,
I've been attempting to fit the data below with an inverse gamma
distribution. The reason for this is outside proprietary software (@Risk)
kicked back a Pearson5 (inverse gamma) as the best fitting distribution with
a Chi-Sqr goodness-of-fit roughly 40% better than with a log-normal fit.
Looking up "Inverse gamma" on this forum led me the following post:
2012 Sep 11
1
Strange result from GAMLSS
Hi Folks! Just started using the gamlss package and I tried a simple code
example (see below). Why the negative sigma?
John
> y <- rt(100, df=1)> m1<-fitDist(y, type="realline")Warning messages:1: In MLE(ll3, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, :
possible convergence problem: optim gave code=1 false convergence
(8)2: In MLE(ll4, start = list(eta.mu =
2001 Feb 26
1
glm: family=exponential() or family=Gamma(alpha=1)?
In glm, is there a way to specify the family
to be exponential, or Gamma but with alpha=1?
This is required by Dobson Exercise 4.3d, page 48.
But without specifying alpha=1, the asnwer is the same
as in the book.
If reply to the list, please cc me a copy.
Thanks.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2018 Jun 03
2
aic() component in GLM-family objects
Is it generally known/has it been previously discussed here that the
$aic() component in GLM-family objects (e.g. results of binomial(),
poisson(), etc.) does not as implemented actually return the AIC, but
rather -2*log-likelihood + 2*(model_has_scale_parameter) ? Can anyone
in this forum gauge how a documentation patch would be received?
This behaviour does not seem to be documented in ?family
2007 May 18
1
Inverse gamma
Hi, All:
assume I need to generate X from inverse gamma with parameter (k, beta).
should I generate from Y from gamma(-k, beta),
then take X=1/Y?
Thanks
pat
2010 Dec 02
1
initial values for alpha and beta in Gamma inverse
Hello
I am trying to fit a model using glm function with family=Gamma(link="inverse").
Is it possible to give initial values, and how? I tried to search for info but not managed to get any answer.
Kind regards and thanks in advance.
Rosario
[[alternative HTML version deleted]]
2011 Jan 13
1
Fitting an Inverse Gamma Distribution
http://r.789695.n4.nabble.com/file/n3216865/Inverse_Gamma.png
Hello,
I am seeking help in estimating the parameters of an inverse gamma
distribution (from the 'actuar' package) using a function like 'fitdistr'.
Unfortunately I haven't found such a package using findFn('fit Inverse
Gamma') from the 'sos' package and was therefore hoping someone might be
aware
2009 Jul 15
1
GLM Gamma Family logLik formula?
Hello all,
I was wondering if someone can enlighten me as to the difference
between the logLik in R vis-a-vis Stata for a GLM model with the gamma
family.
Stata calculates the loglikelihood of the model as (in R notation)
some equivalent function of
-1/scale * sum(Y/mu+log(mu)+(scale-1)*log(Y)+log(scale)+scale*lgamma(1/scale))
where scale (or dispersion) = 1, Y = the response variable, and mu
2009 Dec 07
0
inverse gamma truncated
Hi, all
How can generate a sample from truncated inverse gamma distribution in R?
thanks
2008 Dec 11
2
Validity of GLM using Gaussian family with sqrt link
Dear all,
I have the following dataset: each row corresponds to count of forest floor small mammal captured in a plot and vegetation characteristics measured at that plot
> sotr
plot cnt herbc herbht
1 1A1 0 37.08 53.54
2 1A3 1 36.27 26.67
3 1A5 0 32.50 30.62
4 1A7 0 56.54 45.63
5 1B2 0 41.66 38.13
6 1B4 0 32.08 37.79
7 1B6 0 33.71 30.62
2008 Sep 16
0
Maximum likelihood estimation of a truncated regression model
Hi,
I have a quick question regarding estimation of a truncation
regression model (truncated above at 1) using MLE in R. I will be most
grateful to you if you can help me out.
The model is linear and the relationship is "dhat = bhat0+Z*bhat+e",
where dhat is the dependent variable >0 and upper truncated at 1;
bhat0 is the intercept; Z is the independent variable and is a uniform