Displaying 20 results from an estimated 196 matches for "add1".
Did you mean:
add
2005 Aug 05
0
(PR#8049) add1.lm and add1.glm not handling weights and
David,
Thanks.
The reason add1.lm (and drop1.lm) do not support offsets is that lm did
not when they were written, and the person who added offsets to lm did not
change them. (I do wish they had not added an offset arg and just used the
formula as in S's glm.) That is easy to add.
For the other point, some care is neede...
2005 Aug 04
0
add1.lm and add1.glm not handling weights and offsets properly (PR#8049)
I am using R 2.1.1 under Mac OS 10.3.9.
Two related problems (see notes 1. and 2. below) are illustrated by
results of the following:
y <- rnorm(10)
x <- z <- 1:10
is.na(x[9]) <- TRUE
lm0 <- lm(y ~ 1)
lm1 <- lm(y ~ 1, weights = rep(1, 10))
add1(lm0, scope = ~ x) ## works ok
add1(lm1, scope = ~ x) ## error
lm2 <- lm(y ~ 1, offset = 1:10)
add1(lm0, scope = ~ z) ## works ok
add1(lm2, scope = ~ z) ## gives incorrect results (ignores the offset)
glm0 <- glm(y ~ 1)
glm1 <- glm(y ~ 1, weights = rep(1, 10))
glm2 <- glm(y ~ 1, o...
2013 Jun 25
1
F statistic in add1.lm vs add1.glm
Should the F statistic be the same when using add1() on models created by lm and glm(family=gaussian)?
They are in the single-degree-of-freedom case but not in the multiple-degree-of-freedom case.
MASS:addterm shows the same discrepancy. It looks like the deviance (==residual sum of squares) gets
divided by the number of degrees of freedom for the...
2012 Apr 05
4
Appropriate method for sharing data across functions
...e using <<-
rm(list=ls())
optstart<-function(npar){ # create structure for optimization computations
# npar is number of parameters ?? test??
OPCON<<-list(MAXIMIZE=TRUE, PARSCALE=rep(1,npar), FNSCALE=1,
KFN=0, KGR=0, KHESS=0)
# may be other stuff
ls(OPCON)
}
add1<-function(){
OPCON$KFN<<-1+OPCON$KFN
test<-OPCON$KFN
}
OPCON<<-list(MAXIMIZE=TRUE, PARSCALE=rep(1,4), FNSCALE=1,
KFN=0, KGR=0, KHESS=0)
ls(OPCON)
print(add1())
print(add1())
print(ls.str())
rm(OPCON) # Try to remove the scratchpad
print(ls())
tmp<-readline(&q...
2013 May 14
1
problem in add1's F statistic when data contains NAs?
Shouldn't the F statistic (and p value) for the x2 term in the following calls
to anova() and add1() be the same? I think anova() gets it right and add1()
does not.
> d <- data.frame(y=1:10, x1=log(1:10), x2=replace(1/(1:10), 2:3, NA))
> anova(lm(y ~ x1 + x2, data=d))
Analysis of Variance Table
Response: y
Df Sum Sq Mean Sq F value Pr(>F)
x1 1 52....
2010 Mar 01
0
MASS::loglm - exploring a collection of models with add1, drop1
I'd like to fit and explore a collection of hierarchical loglinear
models that might
range from the independence model,
~ 1 + 2 + 3 + 4
to the saturated model,
~ 1 * 2 * 3 * 4
I can use add1 starting with a baseline model or drop1 starting with the
saturated model,
but I can't see how to get the model formulas or terms in each model as
a *list* that I can work with
further.
Consider this 2 x 3 x 7 x 2 table:
Hoyt1 <-
structure(c(87, 125, 216, 136, 256, 65, 72, 233, 159, 269,...
2012 Aug 13
6
named character question
Dear R People:
Here is a goofy question:
I want to extract the zip code from an address and here is my work so far:
> add1
results.formatted_address
"200 W Rosamond St, Houston, TX 77076, USA"
> add1[1][32:36]
<NA> <NA> <NA> <NA> <NA>
NA NA NA NA NA
> str(add1)
Named chr "200 W Rosamond St, Houston, TX 77076, USA"
- attr(*, "name...
2013 Apr 23
2
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...gradation)
One issue I see is the following:
- 'loop invariant code motion' seems to be depending on the result of the 'reassociate expression' pass:
In the samples below I observer the following behavior:
Both start with the same expression:
%add = add i32 %total.0, %next.0
%add1 = add i32 %add, 1
-LLVM-3.1 converts this into:
--after Reassociate expressions:
%add = add i32 %next.0, 1
%add1 = add i32 %add, %total.0
-- after Canonicalize natural loops:
%add = add i32 %next.0.ph, 1
%add1 = add i32 %add, %total.0
-- and during 'loop invariant code motion':
LIC...
2015 Aug 21
3
unset() function?
...the S/S++ unset() function?
unset(name) would remove 'name' from the current evaluation
frame and return its value. It allowed you to safely avoid
some memory copying when calling .C or .Call.
E.g., suppose you had C code like
#include <R.h>
#include <Rinternals.h>
SEXP add1(SEXP pX)
{
int nProtected = 0;
int n = Rf_length(pX);
int i;
double* x;
Rprintf("NAMED(pX)=%d: ", NAMED(pX));
if (NAMED(pX)) {
Rprintf("Copying pX before adding 1\n");
PROTECT(pX = duplicate(pX)); nProtected++;
} el...
2007 May 21
2
Source code of add1
Se ha borrado un texto insertado con un juego de caracteres sin especificar...
Nombre: no disponible
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070521/f7808713/attachment.pl
2013 Apr 23
0
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...following:
> - 'loop invariant code motion' seems to be depending on the result of the 'reassociate expression' pass:
>
> In the samples below I observer the following behavior:
>
> Both start with the same expression:
> %add = add i32 %total.0, %next.0
> %add1 = add i32 %add, 1
>
> -LLVM-3.1 converts this into:
> --after Reassociate expressions:
> %add = add i32 %next.0, 1
> %add1 = add i32 %add, %total.0
> -- after Canonicalize natural loops:
> %add = add i32 %next.0.ph, 1
> %add1 = add i32 %add, %total.0
> -- and...
2013 Apr 25
2
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...9; seems to be depending on the result of
the 'reassociate expression' pass:
> >>
> >> In the samples below I observer the following behavior:
> >>
> >> Both start with the same expression:
> >> %add = add i32 %total.0, %next.0
> >> %add1 = add i32 %add, 1
> >>
> >> -LLVM-3.1 converts this into:
> >> --after Reassociate expressions:
> >> %add = add i32 %next.0, 1
> >> %add1 = add i32 %add, %total.0
> >> -- after Canonicalize natural loops:
> >> %add = add i32 %next...
2013 Apr 25
0
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...e result of the 'reassociate expression' pass:
> > >>
> > >> In the samples below I observer the following behavior:
> > >>
> > >> Both start with the same expression:
> > >> %add = add i32 %total.0, %next.0
> > >> %add1 = add i32 %add, 1
> > >>
> > >> -LLVM-3.1 converts this into:
> > >> --after Reassociate expressions:
> > >> %add = add i32 %next.0, 1
> > >> %add1 = add i32 %add, %total.0
> > >> -- after Canonicalize natural loops:
> &...
2004 Aug 09
1
[LLVMdev] API on JIT, code snippets
...everal.
I don't know why the demo page at UIUC is unavailable but there is an enhanced
copy of it running on the mirror at http://llvm.x10sys.com/demo/ if you ever
need it. Running it produced the following LLVM equivalent for the C code in
your example.
implementation ; Functions:
int %add1(int %x) {
entry:
%tmp.1 = add int %x, 1 ; <int> [#uses=1]
ret int %tmp.1
}
int %foo() {
entry:
ret int 11
}
Reid
Valery A.Khamenya wrote:
> Reid wrote:
>
>
>>I have to agree with Misha on this. None of us knows "everything" about
>>LLVM and as you can s...
2012 Nov 02
1
add1() alternative
...d a hierarchical logistic regression model with lme4
package, but I have a problem on selecting the variables to include in this
model.
In a simple logistic regression, using Forward selection, i use a likelihood
ratio test to check which variables i should include in the model, using the
function add1().
The problem is that this function doesn't work with the hierarchical model
that i'm trying to achieve.
Example:
model<- glmer(y ~ (1 | group)+x+sex+age, family = binomial("logit"), data =
db)
add1(model, db, test="Chisq")
Error: $ operator not defined for this S...
2004 Aug 09
5
[LLVMdev] API on JIT, code snippets
...PONG?
> :)
>
> --
> Valery.
>
>
> ------------------------------------------------------------------------
>
> /*
> Goal:
> The goal of this snippet is to create in the memory
> the LLVM module consisting of two functions as follow:
>
>
> int add1(int x) {
> return x+1;
> }
>
> int foo() {
> return add1(10);
> }
>
>
> then compile the module via JIT, then execute the `foo'
> function and return result to a driver, i.e. to a "host program".
>
> Some remarks and questions:
>
> -...
2012 Jan 19
2
add1 GLM - Warning message, what does it mean?
Hi All, I am wondering if anyone can tell me what the warning message below
the model means?
J
add1(DTA.glm,~ Aeventexhumed + Veg + Berm + HTL + Estuary + Rayos)
Single term additions
Model:
cbind(MaxHatch, TotalEggs - MaxHatch) ~ Aeventexhumed + Veg +
Berm + HTL
Df Deviance AIC
<none> 488.86 4232.9
Estuary 1 454.96 4201.0
Rayos 3 258.80 4008.9
Warning message...
2007 Mar 13
3
inconsistent behaviour of add1 and drop1 with a weighted linear model
Dear R Help,
I have noticed some inconsistent behaviour of add1 and drop1 with a
weighted linear model, which affects the interpretation of the results.
I have these data to fit with a linear model, I want to weight them by
the relative size of the geographical areas they represent.
_____________________________________________________________________________...
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 us...
2010 Jan 18
1
[LLVMdev] JIT on ARM
Hi.
I am trying to run LLVM with JIT on ARM processor (Android phone).
Currently I have problems using external functions. Any call to external function crashes and gives me signal 11 (SIGSEGV) at some random address.
I'm trying to run following C code:
***
extern void add1(int* x);
int main()
{
int a = 10;
int b = 20;
add1(&b);
int c = a + b;
return c;
}
***
It gives me following LL code:
***
define i32 @main() nounwind {
entry:
%b = alloca i32, align 4 ; <i32*> [#uses=3]
store i32 20, i32* %b, align 4
call v...