search for: ntrial

Displaying 11 results from an estimated 11 matches for "ntrial".

Did you mean: trial
2001 Jan 09
3
log(0) problem in max likelihood estimation
...od estimation must be encountered quite a bit. What do you do when a data point has a probability that comes out in numerical evaluation to zero? In calculating the log likelihood you then have a log(0) problem. Here is a simple example (probit) which illustrates the problem: x<-c(1,2,3,4,100) ntrials<-100 yes<-round(ntrials*pnorm((x-3)/1)) #points fall on normal CDF mean=3, sd=1 no<-ntrials-yes pyes<-yes/ntrials py<-function(b,x) pnorm((x-b[1])/b[2]) loglike<-function(b) -sum( yes*log(py(b,x)) + no*log(1-py(b,x)) ) out<-nlm(loglike,p=c(3,1),hessian=TRUE) In this example t...
2007 Oct 10
2
how to generate and evaluate a design using Algdesign
...iables v3-v4 and v5-v6, the following is the code ################ require(AlgDesign) set.seed(1) levels = c(v1=3,v2=3, v3=4,v4=4,v5=4,v6=4) dat<-gen.factorial(levels,center=FALSE,varNames=names(levels),factors= c(1,2,3,4,5,6)) model = ~.+v3:v4+v5:v6 optDgn<-optFederov(model,dat,nRepeat=5,nTrials = 32,criterion = "D", approximate = F) ---------------------------- this lead to a error msg " nTrials must be greater than or equal to the number of columns in expanded X" . I thought I do not have that many columns. if I change approximate to T, this error has gone. if I re...
2013 Apr 25
2
Loop for main title in a plot
...("Apple"["P"])), xlab=expression(paste("Banana"^"th")), main=expression(paste(italic("i-")~"4"^"th"~"choice"))) Now I would like to include the titel (main) as a function of the number of trails for (trial in 1:nTrials) { plot( main=expression(paste(italic("i-")~"trial"^"th"~"choice"))) } e.g. nTrials = 5 The title should look like this: 5th plot: i ^th choice 4th plot: i-1 ^th choice 3th plot: i-2 ^th choice and so on I have problems to create that, could you please...
2007 Oct 09
2
AlgDesign--exact and approximate design
Hi I am trying to generate a design using Algdesign and came across terms of "exact design" and "approxiamte theory design", I did not find a reference to explain what they are, could some one shed some light about this on me? Another question is, I want to measure the main effects and at least two interactions, variables are factors, how do I ensure this in formula,
2010 Oct 20
2
create a list fails
...21-stuff31), + stuff42=(stuff21-stuff41), + stuff43=(stuff32-stuff42) + ) Error: object 'stuff21' not found > Why does it have to be found, exist previously ... it is being created? But this works fine .... data <- list(Ntrials =numtritot, Ncomparisons=2, treat=c(rep(1 ,N.trials[1,2]), rep(2,N.trials[1,3])), total.patientnums.trt1=dat2[ ,2], total.patientnums.trt23=dat2[ ,2], num.countstrt1=dat2[ ,5], num.countstrt23=dat2[ ,6] ) .... ???? ==========...
2006 Jan 12
0
question for mshapiro test
...e how many times the test would reject the null hypothesis when the p-value is 0.05. The answer should be around 50 since the p-value is 0.05. But I got a much higher value. Here is the R code I used and the result. library(mvnormtest,lib.loc="~/mshapiro") library(MASS) n=50 dim=2 ntrial = 1000 x<-matrix(1:(dim*n),ncol=dim) count = 0 for( trial in 1:ntrial) { x<-mvrnorm(n,rep(0,dim),diag(1,dim,dim)) data_hn<-x p<-mshapiro.test(t(data_hn))$p.value if( p<= 0.05) count <- count+...
2007 Sep 27
3
different colors for two wireframes in same plot
Hello R, According to: g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <- log((g$x^g$g + g$y^2) * g$gr) wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE, screen = list(z = 30, x = -60)) i have two wireframes in one plot. How could i change the color of the top - one to transparent (or only the grid).
1998 Sep 09
0
R-beta: extreme value dose-response fit
Here are my dose-response data: contrast<-c(0,.1,.04,.02,.03) yes<-c(0+3+2+6+0+4+0+8,49+45,42+37,12+3,40+27) ntrials<-c(49+49+53+53+55+61+52+42,51+45,51+39,47+48,47+58) Contrast is the physical variable (dose) being varied. I can fit these data by MLE to a normal or logistic CDF no problem. I have done it both with nlm and glm. But I run into problems when I try to fit them with an extreme value CDF. In n...
2011 Mar 10
0
OptFederov and Dopt.design
...file<- read.table("C:/Upstream/Designs/Vodacom Tanzania phase1 grammar/JMP_allowed.txt",sep="\t",header=TRUE,strip.white=TRUE) formula<-as.formula("~structure+intro + intro/intro1 + concept + concept/concept1 + prize") design<-optFederov(formula, data=file, nTrials=48, evaluateI=T, criterion="D", maxIteration=10000, nRepeats=300, approximate=F,args=T) #------------------------------------------------------------------------------------------------------------------------------------------------------------------------ I also use the Rcmdr in...
2008 Apr 21
3
optFederov/AlgDesign - help avail?
Hello, we are needing to generate optimal (Fractional) designs for discrete choice applications, where we will be using logistic regression or multinomial logit as the modeling technique. It looks like optFederov, in the AlgDesign package may work, but not sure if this algorithm works when the variable of interest is binary or nominal? Anyone who are experts in this area, anyone interested
2006 Jan 20
3
fractional factorial design in R
Hi, i need to create a fractional factorial design sufficient to estimate the main effects. The factors may have any number of levels, let's say any number from 2 to 6. I've tried to use the library conf.design , but i cannot figure out how to write the code. For example, what is the code for a design with 5 factors (2x3x3x5x2) and only main effects not confounded? thanks in advance!