Displaying 20 results from an estimated 23 matches for "ntot".
Did you mean:
not
2003 Oct 14
2
different results depending of variable position.
Hi,
I make an analysis and depending of the order of the variables, the
significance change, look.
m1 <- glm((infec/ntot)~idade+sexo+peso,family=binomial,weights=ntot)
> anova(m1,test="F")
Analysis of Deviance Table
Model: binomial, link: logit
Response: (infec/ntot)
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev F Pr(>F)
NULL 80...
2005 Apr 07
2
about mantelhaen.test (PR#7779)
...= 1, nr = df_SMH)
Y_CSMH <- matrix(0, nc = 1, nr = df_CSMH)
S_GMH <- matrix(0, nc = df_GMH, nr = df_GMH)
S_SMH <- matrix(0, nc = df_SMH, nr = df_SMH)
S_CSMH <- matrix(0, nc = df_CSMH, nr = df_CSMH)
for(k in 1:K) {
V <- NULL
f <- x[, , k]
ntot <- sum(f)
p_ip <- apply(f, 1, sum) / ntot
p_pj <- apply(f, 2, sum) / ntot
m <- p_ip %x% p_pj * ntot
V <- ntot^2 * ((diag(p_ip) - p_ip %*% t(p_ip)) %x% (diag(p_pj) - p_pj
%*% t(p_pj))) / (ntot-1)
Y_GMH <- Y_GMH + A_GMH %*% (c(t(f)) - m)...
2009 Mar 09
1
Zero distance error in corSpatial - correlation structure using lme
...he coordinates are the same for
the same sample. This is demonstrated below using the coordinates STX2
and STY2, which are the same for a single transect. How can I properly
specify this structure in Variogram() and corSpatial()?
library(nlme)
set.seed(1001)
ntrans <- 30
npertrans <- 5
ntot <- ntrans*npertrans
STX1<-runif(ntot, min=16.0921, max=16.4823)
STY1<-runif(ntot, min=1.9812, max=2.3932)
STX2<-rep(runif(ntrans, min=16.0921, max=16.4823), each=npertrans)
STY2<-rep(runif(ntrans, min=1.9812, max=2.3932), each=npertrans)
site<-rep(c(1,2,3), each=ntot/3)
tran<-r...
2009 Jul 23
3
How to pass a character argument which contains expressions to arg.names in barplot?
Hi all
Can anybody help me with this? I am trying to include in an automatic way
the argument in arg.names in a barplot. I generate the labels I want to
appear below the bars with a for loop, and they contain subscripts, so I
need to use expression
anch<-0.05
esp<-4
for (i in 1:dim(Ntot)[1])
{
naux<-Ntot[i,]
naux2<-naux[naux>0]
nind<-which(naux>0)
tit4<-character(0)
for (j in 1:length(nind))
{
tit4<-c(tit4,paste("expression(n[paste[",i,",",nind[j],"])",sep=""))
}
windows()...
2005 Oct 14
2
Fortran?
In a package, i type a function name and got the following message:
...
tmp <- .Fortran("master", x = as.double(x), y = as.double(y),
sort = as.logical(sort), rw = as.double(rw), npd = as.integer(npd),
ntot = as.integer(ntot), nadj = integer(tadj), madj = as.integer(madj),
ind = integer(npd), tx = double(npd), ty = double(npd),
ilist = integer(npd), eps = as.double(eps), delsgs = double(tdel),
ndel = as.integer(ndel), delsum = double(ntdel),
dirsgs =...
2002 Aug 08
0
RE: rmultinom
...); break}
if (any(p > 1.0)) {cat("Some P(i) > 1.0 ","\n"); break}
eps <- .Machine$double.eps^0.9
if (sum(p) > (1.0 + eps) | sum(p) < (1.0 - eps) ) {cat("Sum of P(i)
should equal 1.0 ","\n"); break}
# Initialize variables
ntot <- n
sum <- 1.0
ix <- rep(0,ncat)
# Generate the observation
for (icat in 1:(ncat - 1)) {
prob <- p[icat]/sum
ix[icat] <- rbinom(1,ntot,prob)
ntot <- ntot - ix[icat]
if (ntot <= 0) return(ix)
sum <- s...
2006 Oct 31
0
about mantelhaen.test (PR#7779)
...)
Y_CSMH <- matrix(0, nc =3D 1, nr =3D df_CSMH)
S_GMH <- matrix(0, nc =3D df_GMH, nr =3D df_GMH)
S_SMH <- matrix(0, nc =3D df_SMH, nr =3D df_SMH)
S_CSMH <- matrix(0, nc =3D df_CSMH, nr =3D df_CSMH)
for(k in 1:K) {
V <- NULL
f <- x[, , k]
ntot <- sum(f)
p_ip <- apply(f, 1, sum) / ntot
p_pj <- apply(f, 2, sum) / ntot
m <- p_ip %x% p_pj * ntot
V <- ntot^2 * ((diag(p_ip) - p_ip %*% t(p_ip)) %x% (diag(p_pj) -
p_pj %*% t(p_pj))) / (ntot-1)
Y_GMH <- Y_GMH + A_GMH %*% (c(t(f)) - m)...
2007 Oct 23
1
Multivariate regression tree: problems with surrogate splits
R helpers,
I am working with the R program performing multivariate regression trees (MRT). I have a matrix with species and environmental variables saved as a CSV file (sprot_matrix.csv), I have 42 species and 8 environmental variables (SECCHI+PH+TA+PTOT+NTOT+CHLA+AREA+ MEANDEP) for 104 samples
Title
SpA
SpB
SpC
SpD
Varible1
Variable2
Variable3
Sample1
Sample 2
Sample 3
Sample 4
Sample 5...
2006 Nov 24
2
low-variance warning in lmer
...t unnecessarily complicated simulation
code/demonstration:
---------------
library(lme4)
library(lattice)
simfun <- function(reefeff,ntreat=2,nreef=12,
nreefpertreat=3,
t.eff=10,
totvar=25,seed=NA) {
if (!is.na(seed)) set.seed(seed)
ntot = nreef*nreefpertreat
npertreat=ntot/ntreat
reef = gl(nreef,nreefpertreat)
treat = gl(ntreat,npertreat)
r.sd = sqrt(totvar*reefeff)
e.sd = sqrt(totvar*(1-reefeff))
y.det = ifelse(treat==1,0,t.eff)
r.vals = rnorm(nreef,sd=r.sd)
e.vals = rnorm(ntot,sd=e.sd)
y <- y.det+r.vals[as.n...
2001 Nov 27
3
Equations as arguments to functions
I am trying to pass an equation as an arguement to a function, which seems
pretty straightforward given lazy evaluation.
I constructed the following little test to make sure I sort of knew what I
was doing:
go <- function(X,eq) { C <<- X*2; d <<- eq}
a _ rnorm(100)
go(10,eq=a[.5*length(a)]+C+1)
> C
[1] 20
> d
[1] 21.10551
> a[.5*length(a)]
[1] 0.1055086
Everything
2008 Jul 15
0
implementation of Prentice method in cch()
Case cohort function cch() is in survival package. In cch(), the prentice
method is implemented like this:
Prentice <- function(tenter, texit, cc, id, X, ntot,robust){
eps <- 0.00000001
cens <- as.numeric(cc>0) # Censorship indicators
subcoh <- as.numeric(cc<2) # Subcohort indicators
## Calculate Prentice estimate
ent2 <- tenter
ent2[cc==2] <- texit[cc==2]-eps
fit1 <- coxph(Surv(ent2,texit,cens)~X,eps=e...
2009 Sep 11
0
R - box design-scatter plot für means/regression/lme?
...6 and 12 days after set up.
So I have now following Data:
Giraffe dung: wet/ dry treatment under shadow/sun condition, 3 collection times, always 5 Replikate
Same for the Wildebeest dung.
For the pellets I measured following variables:
DW.P = dry weight pro pellet
WL= water loss
Ctot= total carbon
Ntot=total nitrogen
Now, for my statistics I used:
lme(Y ~ Day*water.T*shadow.T*dung.T, random=~Day|Box/Pot)
but apperently I have to fit a linear correlation for Day, so that Day is not seen as a Factor.. How have I to do that?
Something Day <- corr(Day*Y)?
Then I also have to calculate the regre...
2010 Sep 28
1
ask for a question with cch function
Dear all,
I am reading the cch function source code. But I can not understand the
following codes. Please help me.
What's the fitter here?
fitter <- get(method)
out <- fitter(tenter = tenter, texit = texit, cc = cc, id = id, X = X, ntot
= nn, robust = robust)
[[alternative HTML version deleted]]
2009 Feb 12
3
proposed simulate.glm method
...envir = .GlobalEnv)
set.seed(seed)
RNGstate <- structure(seed, kind = as.list(RNGkind()))
on.exit(assign(".Random.seed", R.seed, envir = .GlobalEnv))
}
## get probabilities/intensities
pred <- matrix(rep(predict(object,type="response"),nsim),ncol=nsim)
ntot <- length(pred)
if (object$family$family=="binomial") {
resp <- object$model[[1]]
size <- if (is.matrix(resp)) rowSums(resp) else 1
}
val <- switch(object$family$family,
poisson=rpois(ntot,pred),
binomial=rbinom(ntot,prob=pred,size...
2008 Nov 05
2
puzzled by cat() behaviour when argument '...' is a vector (and argument 'sep' contains "\n")
...le,
an element of vector 'sep' is /not/ printed out after each element
of the vector passed as argument '...' to cat(), "including the last"
--- confer the for-loop over the elements of '...' in lines 596-617
and the print-out of the separator
cat_printsep(sepr, ntot);
in line 600. Once again: Is this intended?
A patch fixing my problem would be easy, though might crash
other much more important code; would you have any
proposals?
Best,
Peter
-------------------------------------------------------------------
Version:
platform = i386-pc-mingw32
arch = i38...
2002 Jun 11
2
Puzzled by what Rprof is telling me
...172.84 "=="
3.08 12.48 0.50 2.04 "lm.fit"
1.72 6.96 0.23 0.94 "median"
(remainder omitted)
nrow() has 340 total and 41 self seconds, a large portion of the
total run time.
There is only one call to nrow() in my code,
ntot <- nrow(dati)
where dati is a subset of the numeric matrix, indat.
I tried replacing nrow(dati) with length(dati[,1])
The profile is then:
----------------- Rprof output, v2 ----------------
Each sample represents 0.02 seconds.
Total run time: 403.699999999923 seconds.
Total seconds: time sp...
1999 Apr 22
0
mvfft
...es to
get the dimensions of the argument (fourier.c: 125), but
gets junk instead, since the argument is not an array.
2) mvfft causes a segmentation fault or gets stuck in a loop
R> mvfft(xx)
Program received signal SIGSEGV, Segmentation fault.
0x80d36cb in fftmx (a=0x40617eb0, b=0x40617eb8, ntot=30, n=30, nspan=30,
isn=-2, m=3, kt=0, at=0x407c8f58, ck=0x407c8f80, bt=0x407c8fa8,
sk=0x407c8fd0, np=0x407c8ee4, nfac=0x8115a78) at fft.c:558
558 bt[j] = b[k1] - b[k2];
(gdb) print bt[j]
Cannot access memory at address 0x407cb000.
(gdb) print kspan
$4 = 0
We're in a loop her...
2000 May 13
1
Semi-off-topic ramblings
I'm curious if anyone else is at all fed up with the current
state-of-affairs of media support under *IX. As things stand it's rather
a pain to add support for a new codec/framing format to an application,
and it seems like were someone to step up and design a system which
abstracts media support from end-user applications and supports drop-in
modules for framing formats and codecs, it
1999 Apr 22
1
mvfft (PR#176)
...es to
get the dimensions of the argument (fourier.c: 125), but
gets junk instead, since the argument is not an array.
2) mvfft causes a segmentation fault or gets stuck in a loop
R> mvfft(xx)
Program received signal SIGSEGV, Segmentation fault.
0x80d36cb in fftmx (a=0x40617eb0, b=0x40617eb8, ntot=30, n=30, nspan=30,
isn=-2, m=3, kt=0, at=0x407c8f58, ck=0x407c8f80, bt=0x407c8fa8,
sk=0x407c8fd0, np=0x407c8ee4, nfac=0x8115a78) at fft.c:558
558 bt[j] = b[k1] - b[k2];
(gdb) print bt[j]
Cannot access memory at address 0x407cb000.
(gdb) print kspan
$4 = 0
We're in a loop her...
2007 Jun 27
2
Meta-Analysis of proportions
Dear colleagues,
I'm conducting a meta-analysis of studies evaluating adherence of HIV-positive drug users into AIDS treatment, therefore I'm looking for some advice and syntax suggestion for running the meta-regression using proportions, not the usual OR/RR frequently used on RCT studies.
Have already searched already several handbooks, R-manuals, mailing lists, professors, but... not