Displaying 20 results from an estimated 1000 matches similar to: "R Error/Warning Messages with library(MASS) using glm."
2012 Mar 14
1
Glm and user defined variance functions
Hi,
I am trying to run a generalized linear regression using a negative binomial
error distribution. However, I want to use an overdispersion parameter that
varies (dependent on the length of a stretch of road) so glm.nb will not do.
>From what I've read I should be able to do this using GLM by specifying my
own quasi family and describing the variance function using varfun, validmu,
2001 May 16
0
glm.nb difficulties
I'm having problems (or to be precise a student is having problems,
which I'm having problems helping her with) trying to use glm.nb() from
the MASS package to do some negative binomial fits on a data set that is,
admittedly, wildly overdispersed (some zeros and some numbers in the
hundreds).
glm.nb is failing to converge, and furthermore is (to my surprise)
producing values of theta
2013 Apr 06
1
Plotting a curve for a Holling Type III Functional Response
Hey,
So I have a scatter plot and I am trying to plot a curve to fit the data
based on a Holling Type III functional response. My function is this:
nll2<-function(a,b) {
conefun<-(a*DBH^2)/(b^2+DBH^2)
nlls2<-dnbinom(x=cones ,size=DBH, mu=conefun,log=TRUE)
-sum(nlls)
}
and my plot is this:
plot (DBH,cones)
DBH is on the x-axis and cones is on the y-axis. How do I get the curve
2013 Feb 28
3
Negative Binomial Regression - glm.nb
Dear all,
I would like to ask, if there is a way to make the variance / dispersion parameter $\theta$ (referring to MASS, 4th edition, p. 206) in the function glm.nb dependent on the data, e.g. $1/ \theta = exp(x \beta)$ and to estimate the parameter vector $\beta$ additionally.
If this is not possible with glm.nb, is there another function / package which might do that?
Thank you very much for
2008 Dec 14
1
error with sqldf v0-1.4
I'm getting an error message when using the new version of sqldf,
> library(sqldf)
> str(kdv)
'data.frame': 71 obs. of 3 variables:
$ dpss: num 0.117 0.144 0.164 0.166 0.165 ...
$ npdp: num 0.1264 0.0325 0.0109 0.0033 0.0055 ...
$ logk: num 1.12 1.29 1.41 1.41 1.42 ...
> test=sqldf("select * from kdv")
Error in get("fun", env = this, inherits =
2011 Nov 12
1
Subsetting data leads to funky plots
I'm trying out a basic plot, but something about the way I subset my data
leads to problems with the plot.
Here is the first bit of my data set
year,date,location,quadrat_juvenile,photo_location,photo_exists,genus,count,divers
2005,2005-04-30, 1 Fringing Reef,1, 1 Fringing Reef Coral Transect Pole 1-2
Quadrat 1,t,Acanthastrea,0,HP+MEM
2005,2005-04-30, 1 Fringing Reef,1, 1 Fringing Reef
2010 Nov 15
1
comparing levels of aggregation with negative binomial models
Dear R community,
I would like to compare the degree of aggregation (or dispersion) of
bacteria isolated from plant material. My data are discrete counts
from leaf washes. While I do have xy coordinates for each plant, it
is aggregation in the sense of the concentration of bacteria in high
density patches that I am interested in.
My attempt to analyze this was to fit negative binomial
2011 Apr 04
1
Clarks 2Dt function in R
Dear Ben,
you answerd to Nancy Shackelford about Clarks 2Dt function.
Since the thread ended just after your reply,
I would like to ask, if you have an idea how to use this function in R
I defined it the following way:
function(x , p, u) {
(p/(pi*u))*(1+(x^2/u))^(p+1)
}
and would like to fit this one to my obeservational data (count)
[,1] [,2]
[1,] 15 12
[2,] 45 13
[3,]
2011 Jul 26
1
nls - can't get published AICc and parameters
Hi
I'm trying to replicate Smith et al.'s
(http://www.sciencemag.org/content/330/6008/1216.abstract) findings by
fitting their Gompertz and logistic models to their data (given in
their supplement). I'm doing this as I want to then apply the
equations to my own data.
Try as a might, I can't quite replicate them. Any thoughts why are
much appreciated. I've tried contacting the
2009 Nov 22
0
Repeated measures unbalanced in a split-split design
Hi,
I have a experiment with block, plots, sub-plots, and sub-sub-plots
with repeated measures and 3 factors (factorial design) when we have
been observed diameter (mm), high (cm) and leaves number (count).
However, we don't have one treatment in one factor, so, my design is
unbalanced.
On a previous message here, a friend tell me that "It appears to me
that your design is a split-split
2006 Feb 16
1
cv.glm function error message in a loop
Dear list,
I am modelling fish distributions using the glm-function followed by the
step-function, and then want to cross-validate the model via the
cv.glm-function from the {boot} package. I am working on fish
distributions on coral reefs. The code I have works for one fish
species. Since I have 227 fishes, I wrote a loop. Now the
cv.glm-function comes up with an error message: "Error in
2009 Nov 22
1
Input file format to Anova from car package
Dear list member,
My question is related to input file format to an Anova from car package.
Here is an example of what I did:
My file format is like this (and I dislike the idea that I will need
to recode it):
Hormone day Block Treatment Plant Diameter High N.Leaves
SH 23 1 1 1 3.19 25.3 2
SH 23 1 1 2 3.42 5.5 1
SH 23 1 2 1 2.19 5.2 2
SH 23 1 2 2 2.17 7.6 2
CH 23 1 1 1 3.64 6.5 2
CH 23 1 1 2
2008 Jun 04
1
"& not meaningful for factors"
I am trying to define groupings from levels of factor variables and this the warning message that R give
"& not meaningful for factors".
The nature of my task is this. I have a variable stage which has the levels (1B, 2A, 2B) - these are the AJCC TNM stages of cancer, and another variable diameter with factor levels ("=< 4", "4 - 6.5, > 6.5; limit values are
2002 Dec 12
0
if problem in function
Dear all,
I have written a function for calculating the volume of a tree (=trad) or
snag (=h?gst).
The included volume regreesion model includes ten parameter values, which
are tree species specific.
bj?rk.formh?jd.pars is an object which includes the parameter values
(parameter set) for birch (=bj?rk).
There is one row per tree in the data object.
> relev.kols[1:5,
2010 Mar 30
0
Diameter for Asterisk, Traffix Diameter stack ?
Hi,
I need a Diameter protocol stack (DDA/Ro) for Asterisk.
I came across Traffix Systems Diameter stack. according to the site they got Asterisk ready Diameter stack and also Diameter Gateway that can interface to Asterisk, has anyone tried those out ?
thanks
Maria
2002 Jul 19
1
selfStart function problem
Hello, list,
I am making a self-starting nonlinear function to model the relation of tree height (H)
and diameter (D) in a forest stand. The function I am trying is
H=a*exp[b*(D+5.8)^(-c)].
To calculate the initial estimates of the parameters, I linearized the formula by taking
logarithms and fixing the parameter c=1. Then I calculated the initial estimates of a
and b using lm() on the
2007 May 18
1
Goodness-of-fit test for gamma distribution?
Hi all,
I am wondering if anyone has written (or knows of) a function that
will conduct a goodness-of-fit test for a gamma distribution. I am
especially interested in test statistics have some asymptotic
parametric distribution that is independent of sample size or values
of fitted parameters (e.g., a chi-squared distribution with some
fixed df), because I want to fit gamma distributions to
2010 Sep 27
4
Fitting problem
Hi,
I have a function that generates a set of data but I am having problems
determining the parameters using the nls fitting procedure.
####
"MH"<-function(field,diameter,mu=10e-7,sig=0.1,Ms=100,chi=0){
#variables mu, sig, chi, Ms
#input: field and diameter
#all in CGS
rho <- 5
kb <- 1.38e-16
t <- 300
length.d<-length(diameter)
length.H<-length(field)
2003 Jan 10
1
plot() and lines() multivariate problem
Dear list
I'm trying to solve the following problem since 2 days with no success.
Could someone help a newbie, please ?
I have a dependant variable which is diameter of shell, and two factors
which are level on the beach (3 levels 'B', 'E' and 'H') and a hydrodynamics
indice (3 levels 1, 2 and 3)
To study diameter variations according to these factors, I may use
2003 Jan 20
1
make check for R-1.6.2 on IBM AIX
Dear all,
The 'make check' step fails for the pacakge mva on IBM AIX.
The tail of the Rout log file looks like:
> for(factors in 2:4) print(update(Harman23.FA, factors = factors))
Call:
factanal(factors = factors, covmat = Harman23.cor)
Uniquenesses:
height arm.span forearm lower.leg weight
0.170 0.107 0.166