Displaying 20 results from an estimated 5000 matches similar to: "Pearson residuals in quasi family"
2006 Jun 12
1
variance specification using glm and quasi
Hi all,
Cameron and Trivedi in their 1998 Regression Analysis of Count Data refer to
NB1 and NB2
NB1 is the negative binomial model with variance = mu + (alpha * mu^1)
yielding (1+alpha)*mu
NB2 sets the power to 2; hence, variance = mu + (alpha*mu^2)
I think that NB2 can be requested via
negbin2<-glm(hhm~sex+age,family=quasi(var="mu^2",link="log"))
Is
2019 Apr 26
1
Error in glm(..., family=quasi(..., variance=list(...)))
In a glm() call using a quasi() family, one may define a custom variance function in the form of a "list containing components varfun, validmu, dev.resids, initialize and name" (quoting the help page for family). In trying to do so, I run into the following issue that I have not seen discussed previously:
x <- runif(1000, min=0, max=1)
y <- x + rnorm(1000, mean=0, sd=1)*x^(3/4)
2006 Mar 31
1
add1() and glm
Hello,
I have a question about the add1() function and quasilikelihoods for GLMs.
I am fitting quasi-Poisson models using glm(, family = quasipoisson).
Technically, with the quasilikelihood approach the deviance does not have
the interpretation as a likelihood-based measure of sample information.
Functions such as stepAIC() cannot be used. The function add1() returns
the change in the scaled
2012 Jul 24
1
Function for ddply
Hello, all. I'm new to R and just beginning to learn to write functions. I
know I'm out of my depth posting here, and I'm sure my issue is mundane.
But here goes. I'm analyzing the American National Election Study (nes),
looking at mean values of a numeric dep_var (environ.therm) across values
of a factor (partyid3). I use ddply from plyr and wtd.mean from Hmisc. The
nes requires a
2009 Nov 20
1
different results across versions for glmer/lmer with the quasi-poisson or quasi-binomial families: the lattest version might not be accurate...
Dear R-helpers,
this mail is intended to mention a rather trange result and generate potential useful comments on it. I am not aware of another posts on this issue ( RSiteSearch("quasipoisson lmer version dispersion")).
MUsing the exemple in the reference of the lmer function (in lme4 library) and turning it into a quasi-poisson or quasi-binomial analysis, we get different results,
1998 May 13
1
all.equal
I need the function all.equal which is in Splus but not yet in R. Below is a
first cut. Comments would be appreciated.
Paul Gilbert
_______
all.equal <- function(obj1, obj2, ...)
{if(mode(obj1) != mode(obj2) ) return("modes differ.")
if(class(obj1) != class(obj2)) return("classes differ.")
if(! all(unlist(attributes(obj1)) ==
2010 Mar 05
1
Changing the Prompt for browser()
Is there a way that I can change the prompt for within a browser() call. I
often use use code like
> with(obj1,browser())
Browse[1]>
Is there a way that I can set it so that I can get something like
> with(obj1,browser(prompt="obj1"))
obj1[1]>
I know that prompt is not a valid option for browser, but it would be nice
if it were. There is an option('prompt")
2010 Mar 05
1
Changing the Prompt for browser()
Is there a way that I can change the prompt for within a browser() call. I
often use use code like
> with(obj1,browser())
Browse[1]>
Is there a way that I can set it so that I can get something like
> with(obj1,browser(prompt="obj1"))
obj1[1]>
I know that prompt is not a valid option for browser, but it would be nice
if it were. There is an option('prompt")
2010 May 26
1
problem with not in in subseting dataframe
Hi all,
I have a problem while subsetting a dataframe that is
while I am using *%in%* condition like
*stemp<-subset(temp, obj1 %in% obj2,select=c(temp))*
this is working and giving results that what ever is there is both *obj1*and
*obj2*
**
**
but I want to get values which is there in *obj1* but not in *obj2 *
can anyone help me how to get those values.
i tried with *%o%* but i am not
2004 Jan 16
2
reference to objects
Hi,
is there a way to reference to a data object without copying it?
For example I have a huge matrix called dist and I want two objects
obj1 and obj2 to have a memeber dist that points to the matrix, but
I don't want, for memory reasons, to copy the matrix twice.
As far as I understand the following code will generate three copies
of my data:
dist <- some_code_that_generates_data
2011 Sep 07
1
access objects
hi,
say I have consecutively numbered objects obj1, obj2, ... in my R workspace.
I want to acces one of them inside a function, with the number given as an argument.
Where can I find help on how to do that? Somebody must have been trying to do this before...
Some keywords to start a search are appreciated as well.
Here's an example, I hope it clarifies what I'm trying to do:
obj1 <-
2006 Jan 13
1
How to disconnect to a database????
Hi,
We have experienced some problems with
ActiveRecord::Base class of Ruby-Rails. We are
building a web-application based on the Ruby-rails
framework and the web-application needs to access to
difference databases, so we do not pre-define our
database accesses in the database.yml file. In fact,
we are using the
ActiveRecord::Base.establish_connection() to connect
to our database, the function
2001 Oct 01
1
generic default values
I have a generic function
test.equal <- function(obj1, obj2, ...) UseMethod("test.equal")
however, the only argument that specific methods use is "fuzz" so I
would like to change this to
test.equal <- function(obj1, obj2, fuzz=???) UseMethod("test.equal")
The problem is that some methods use slightly different default values
for fuzz than others. How should
2011 Oct 13
1
binomial GLM quasi separation
Hi all,
I have run a (glm) analysis where the dependent variable is the gender
(family=binomial) and the predictors are percentages.
I get a warning saying "fitted probabilities numerically 0 or 1 occurred"
that is indicating that quasi-separation or separation is occurring.
This makes sense given that one of these predictors have a very influential
effect that is depending on a
2010 Mar 14
3
likelihood ratio test between glmer and glm
I am currently running a generalized linear mixed effect model using glmer and I want to estimate how much of the variance is explained by my random factor.
summary(glmer(cbind(female,male)~date+(1|dam),family=binomial,data= liz3"))
Generalized linear mixed model fit by the Laplace approximation
Formula: cbind(female, male) ~ date + (1 | dam)
Data: liz3
AIC BIC logLik deviance
241.3
2008 Dec 23
1
.C and 'temporaries'
Hello,
Before I get into troubles I ask here:
I make a call to a C function using .C. What I would like to know is if
the arguments in the .C call can also be 'temporary' objects.
An example will illustrate this:
# here we don't have a temporary
Obj1 = 5
.C("Func", as.integer(Obj1 ), ...) # certainly works
# here we do have a temporary
Obj2 = 5
.C("Func",
2013 Sep 06
1
directives to explicitely exclude objects from import into namespaces
Hi,
recently R CMD check --as-cran has noticed some more issues with
package namespace imports with the recommended remedy to
use importFrom() and friends.
In my case, there was only a conflict restricted to some few imports,
while I would prefer to still import all the non-conflicting objects,
methods, and classes of the respective package namespace.
So would it be possible to have some new
2011 Oct 05
6
reporting multiple objects out of a function
Dear folks,
I?m trying to build a function to create and make available some variables I
frequently use for testing purposes. Suppose I have a function that takes
some inputs and creates (internally) several named objects. Say,
fun1 <- function(x, y, z) {obj1 <- x; obj2 <- y; obj3 <- z
<missing stuff>
}
Here is the challenge: After I run it, I want the objects to be
2015 Dec 02
2
Support token type in struct for landingpad
Hi David,
Sorry to bother you, but I would like to get some suggestions on your recent work of token type.
I’m currently working on changing gc.statepoint to return a token type instead of a i32 type. The reason is that with the current implementation, gc.statepoint could potentially be fed into PHI nodes, and break RewriteStatepointsForGC pass later. Using token type would help us to avoid
2005 Jul 04
3
How difficult is it to wrap a large C++ library with R?
Dear list,
I have developed a forward-time population genetics simulation
environment simuPOP, which is a set of C++ (template)
classes/functions wrapped by SWIG as Python libraries. R is used
extensively as plotting and statistical analysis engine through RPy
package.
I use Python to wrap simuPOP since most the following can be easily
done using SWIG or Python C API. However, since Python is