Displaying 20 results from an estimated 346 matches for "stratum".
2009 Aug 19
2
how do i vectorize relational queries in R
...a way to vectorize it?
Example:
> data <- data.frame(c(1,1,1,2,2,2,3,3,3),rep(2,9)); names(data) <-
> c("Sample","Score")
> meta <- data.frame(c(1,2,3),c("Tree","Tree","Shrub")); names(meta) <-
> c("Sample","Stratum")
The following attempt at vectorizaton doesn't work:
> data$Stratum <- meta$Stratum[which(data$Sample == meta$Sample)]
> data$Stratum
[1] Tree <NA> <NA> Tree <NA> <NA> Tree <NA> <NA>
And actually, when I try to run a loop, the operation co...
2006 Jun 18
1
Post Stratification
...n in Vienna, I think even more fondly
of this community and hope to continue on this route. It was great
talking with you and learning from you. Thank you. I am trying to work
through an artificial example in post stratification. This is my dataset:
library(survey)
age <- data.frame(id=1:8, stratum=rep( c("S1","S2"),c(5,3)),
weight=rep(c(3,4),c(5,3)), nh=rep(c(5,3),c(5,3)),
Nh=rep(c(15,12),c(5,3)), y=c(23,25,27,21,22, 77,72,74) )
pop.types <- table(stratum=age$stratum)
age.post <- svydesign(ids=~1, strata=NULL, data=age, fpc=~Nh) ## no
clusters, no strata
post &...
2005 May 26
1
Survey and Stratification
...board's intention, but I have come to a complete stop in my efforts
and need an expert to help me along. Please help:
age<-matrix(c(rep(1,5), rep(2,3), 1:8, rep(3,5), rep(4,3), rep(5,5),
rep(3,3), rep(15,5), rep(12,3), 23,25,27,21,22, 33,27,29), ncol=6, byrow=F)
colnames(age)<-c("stratum", "id", "weight", "nh", "Nh", "y")
age<-as.data.frame(age)
## create survey design object
age.des1<-svydesign(ids=~id, strata=~stratum, weight=~Nh, data=age)
svymean(~y, age.des1)
## gives mean 25.568, SE 0.9257
age.des2<-svydesign(i...
2011 May 05
5
May 05 07:20:21 imap: Warning: Time jumped forwards 16 seconds
Hello
I get this warning in dovecot.log
the machine is running ntpd so this is
a bit strange ...
2010 Aug 25
1
Surprising behaviour survey-package with missing values
...many different variables with different
missing values, this is not very practical. Is there an easy way to
get the behaviour I want?
Thanks for your help.
With regards,
Jan van der Laan
=== EXAMPLE ===
library(survey)
library(plyr)
# generate some data
data <- data.frame(
id = 1:20,
stratum = rep(c("a", "b"), each=10),
income = rnorm(20, 100),
n = rep(c(100, 200), each=10)
)
data$income[5] <- NA
# calculate mean and total income for every stratum using survey package
des <- svydesign(ids=~id, strata=~stratum, data=data, fpc=~n)
svyby(~income, by=~strat...
2005 Dec 21
2
Newbie - Summarize function
Dear R Users,
I have searched through the archives but I am still struggling to find a
way to process the below dataset. I have a dataset that has stratum and
plot identifier. Within each plot there is variable (Top) stating the
number of measurments that should be used to to calculate the mean to the
largest "top" elements within one of the vectors (X). I would like to
process this summary statistic by groups. At this stage I have been...
2006 Mar 23
2
clogit question
Hi,
I am playing with
clogit(case~spontaneous+induced+strata(stratum),data=infert)
from clogit help file.
This line works.
1. But, why strata(stratum) doesn't have a coefficient like spontaneous
and induced?
2. When I remove strata(stratum) from the command, this function seems
to keep running forever. Why?
3. I think the equation for clogit looks like
P=1...
2009 Apr 25
3
Nomogram with stratified cph in Design package
...Stratified Nomogram:
f<-cph(S~A+B+C+D+E+F+strat(H),x=T,y=T,surv=T,time.inc=10*12,method="breslow")
srv=Survival(f)
surv.p <- function(lp) srv(10*12, lp, stratum="Hist=P")
surv.f <- function(lp) srv(10*12, lp, stratum="Hist=F")
surv.o <- function(lp) srv(10*12, lp, stratum="Hist=O")
quant=Quantile(f)
med.p <- function(lp) quant(.5, lp, stratum="Hist=P")
med.f <- function(lp) quant(.5, lp, stratum="His...
2010 Apr 27
1
Randomization for block random clinical trials
...earch expedition has lead me
to believe that blockrand package will most probably be the answer to it.
I’ve played around with blockrand for awhile and tried the sample code:
library(blockrand)
##stratified by sex
male <- blockrand(n=100, id.prefix='M', block.prefix='M',stratum='Male')
female <- blockrand(n=100, id.prefix='F', block.prefix='F',stratum='Female')
my.study <- rbind(male,female)
my.mystudy
this generates a beautiful list of randomised list perfect stratified by
sex. However, i cannot figure out how i can add in ad...
2010 Apr 07
1
Struggeling with svydesign()
...blocks is a 20 by 50 km geographical region. Type is a two level
factor. Not every level is present in each block. Each block has a
Status attribute with two levels: medium (9 blocks) or good (5 blocks).
Besides the overall ratio, we would like the estimate the ratio per
Status.
The samplesize per stratum was calculated with epi.stratasize() from the
epiR package. The population size in the 21 strata ranges from 1 to
1158. The sample size ranges from 0 in the blocks with very few polygons
(<20), 1 in blocks with a low number of polygon (20 - 50) and up to 25
polygons in the largest strata.
Does...
2009 Oct 06
3
"Time just moved backwards" in Dovecot in a Xen DomU
...p\.conf
5696 ? Ss 1:05 /usr/sbin/ntpd -p /var/run/ntp/ntpd.pid
-g -u ntp:ntp -i /var/lib/ntp -c /etc/ntp.conf
and,
grep localtime /etc/xen/vm/mail.cfg
localtime = 0
looking at my ntp logs around the same time(s).
...
5 Oct 16:41:17 ntpd[5696]: synchronized to 64.125.78.85, stratum 1
5 Oct 16:51:38 ntpd[5696]: time reset -2.140133 s
5 Oct 16:56:40 ntpd[5696]: synchronized to 66.220.9.122, stratum 1
5 Oct 17:01:28 ntpd[5696]: synchronized to 64.125.78.85, stratum 1
5 Oct 17:07:20 ntpd[5696]: time reset -2.137760 s
5 Oct 17:11:49 ntpd[5696]: synchronized to 204.152.184.72,...
2004 Feb 02
0
Two apparent bugs in aov(y~ *** -1 + Error(***)), with (PR#6520)
...fit this model? It differs only in the coding from
aov(y ~ a + b + Error(c), data=test.df)
and merely lumps together the top two strata.
There is a much simpler fix: in the line
if(intercept) nmstrata <- c("(Intercept)", nmstrata)
remove the condition (and drop the empty stratum later if you want).
On Fri, 30 Jan 2004 b-h@mevik.net wrote:
> I think there are two bugs in aov() that shows up when the right hand
> side of `formula' contains both `-1' and an Error() term, e.g.,
> aov(y ~ a + b - 1 + Error(c), ...). Without `-1' or `Error()' there
&g...
2004 Jan 30
0
Two apparent bugs in aov(y~ *** -1 + Error(***)), with suggested (PR#6510)
...formula' contains both `-1' and an Error() term, e.g.,
aov(y ~ a + b - 1 + Error(c), ...). Without `-1' or `Error()' there
is no problem. I've included and example, and the source of aov()
with suggested fixes below.
The first bug (labeled BUG 1 below) creates an extra, empty stratum
inside `Within' in the result list (se example below).
The second bug (BUG 2) assigns the fit of each stratum at one index
too high in the result list; i.e., the fit of stratum 1 is assigned to
`Stratum 2' etc. `Stratum 1' is NULL. (Also the extra stratum added
by BUG 1, is NULL.)
*...
2008 May 20
2
Strange NTP problem
...3 ntpd[31792]: Listening on interface eth0,
10.66.42.109#123 Enabled
May 20 11:35:38 hepdsw03 ntpd[31792]: kernel time sync status 0040
May 20 11:35:38 hepdsw03 ntpd[31792]: frequency initialized 0.000 PPM
from /var/lib/ntp/drift
May 20 11:38:55 hepdsw03 ntpd[31792]: synchronized to LOCAL(0),
stratum 10
May 20 11:38:55 hepdsw03 ntpd[31792]: kernel time sync disabled 0001
May 20 11:39:59 hepdsw03 ntpd[31792]: synchronized to 10.101.32.104,
stratum 3
May 20 11:40:58 hepdsw03 ntpd[31792]: synchronized to LOCAL(0),
stratum 10
May 20 11:42:09 hepdsw03 ntpd[31792]: synchronized to 10.101.32.104,...
2003 Dec 11
1
nested aov: plot available?
Hi all,
I wonder whether, for an anova with multiple error strata, it is possible to
produce the same diagnostoc plots than with a single-stratum anova.
I can extract the residuals for each stratum with e.g.
> resid(split1.aov[["block:plot"]])
> resid(split1.aov[["Within"]])
and then produce qqnorm plots etc manually, but is it possible to get all the
plots (residuals vs fitted, cook's distance etc) by stra...
2005 Jun 02
0
How to calculate the correct SE in a nested or spliplot anova?
Hi!
How to calculate the correct SE of mean in a nested or spliplot anova?
Nested example:
---------------------
m <- aov(Glycogen~Treatment+Error(Treatment/Rat/Liver))
> m
Call:
aov(formula = Glycogen ~ Treatment + Error(Treatment/Rat/Liver))
Grand Mean: 142.2222
Stratum 1: Treatment
Terms:
Treatment
Sum of Squares 1557.556
Deg. of Freedom 2
Estimated effects may be unbalanced
Stratum 2: Treatment:Rat
Terms:
Residuals
Sum of Squares 797.6667
Deg. of Freedom 3
Residual standard error: 16.3061
Stratum 3: Trea...
2011 Dec 12
1
k-folds cross validation with conditional logistic
--begin inclusion --
I have a matched-case control dataset that I'm using conditional
logistic regression (clogit in survival) to analyze. I'm trying to
conduct k-folds cross validation on my top models but all of the
packages I can find (CVbinary in DAAG, KVX) won't work with clogit
models. Is there any easy way to do this in R?
-end inclusion --
The clogit funciton is simply a
2006 Feb 08
1
ERROR: no applicable method for "TukeyHSD"
...s)
> require(stats)
[1] TRUE
>
> tHSD <- TukeyHSD(aov)
Error in TukeyHSD(aov) : no applicable method for "TukeyHSD"
In case it helps:
> aov
Call:
aov(formula = roi ~ (Cue * Hemisphere) + Error(Subject/(Cue *
Hemisphere)), data = roiDataframe)
Grand Mean: 8.195069
Stratum 1: Subject
Terms:
Residuals
Sum of Squares 645.7444
Deg. of Freedom 7
Residual standard error: 9.604645
Stratum 2: Subject:Cue
Terms:
Cue Residuals
Sum of Squares 0.386987 4.015740
Deg. of Freedom 1 7
Residual standard error: 0.75...
2014 Dec 11
2
HOWTO Stratum 1 NTP server under CentOS 7
...anyone is interested, I have created a HOWTO
on running a Motorola GPS receiver connected to
a CentOS 7 box via serial port (com1),
with 1PPS over DCD.
The trick here is that CentOS 7 uses systemd
and setup was a bit different. Anyway,
everything works.
The result is a highly accurate NTP server, Stratum 1.
Here is the documentation.
http://www.maximaphysics.com/Centos_7_GPS_Setup.html
Let me know if something does not look right.
-George, N2FGX
2014 Feb 07
1
Time sync
...' -v
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535
bytes
14:34:05.797192 IP (tos 0x0, ttl 128, id 21522, offset 0, flags [none],
proto UDP (17), length 76)
10.48.16.29.49352 > domainc01.zirc.tak.lan.ntp: NTPv1, length 48
Client, Leap indicator: (0), Stratum 0 (unspecified), poll 0s,
precision 0
Root Delay: 0.000000, Root dispersion: 0.000000, Reference-ID:
(unspec)
Reference Timestamp: 0.000000000
Originator Timestamp: 0.000000000
Receive Timestamp: 0.000000000
Transmit Timestamp: 3600768998.104618...