Re: [R] [newbie] mesuring adequation of normal distribution with avariable

2007-04-02 Thread Boks, M.P.M.
I am not sure what you mean with adequation, but maybe ?shapiro.test is
what you are looking for?

BW,

Marco

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens [EMAIL PROTECTED]
Verzonden: zondag 1 april 2007 10:55
Aan: r-help@stat.math.ethz.ch
Onderwerp: [R] [newbie] mesuring adequation of normal distribution with
avariable


Hello,

I'm looking for a way of mesuring the adequation of a given variable
with the normal distribution. Does R provide a standard test for this
purpose, or is there a statistical methodology?

Best,
Sylvain Loiseau

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] only need the p-value

2006-09-30 Thread Boks, M.P.M.
 

Dear R users,

 

I am calculating several cox proportional hazard models after each other (I 
know this is unusual, but I am just exploring the data). For the purpose of 
multiple testing correction I need to construct an array of these p-values. 
However since the output is not an array in itself, I cannot find a way to 
obtain the p-value only.

 

 attach(tms)  

 

 goal-rep(0.7*FREQUENC[1:13],6)

 event- Surv(TIJD,FREQUENCgoal)

 results-coxph(event~ TYPETREA)

 summary(results)

 

Call:

coxph(formula = event ~ TYPETREA)

 

  n=76 (2 observations deleted due to missing)

 coef exp(coef) se(coef) z p

TYPETREAnon-guided -0.826 0.4380.484 -1.71 0.088

 

   exp(coef) exp(-coef) lower .95 upper .95

TYPETREAnon-guided 0.438   2.28 0.169  1.13

 

Rsquare= 0.041   (max possible= 0.829 )

Likelihood ratio test= 3.2  on 1 df,   p=0.0737

Wald test= 2.91  on 1 df,   p=0.088

Score (logrank) test = 3.08  on 1 df,   p=0.0794

 

Does anyone now how to extract the p-value?

Many thanks!,

Marco

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] paste? 'cmd /c c:\\pheno\\whap --file c:\\pheno\\smri --alt 1'

2006-09-25 Thread Boks, M.P.M.
Dear R users,
 
This command works (calling a programm -called whap- with file specifiers etc.):
 
system('cmd /c c:\\pheno\\whap --file c:\\pheno\\smri --alt 1 --perm 500', 
intern=TRUE)
 
Now I need to call it from a loop to replace the 1 by different number, 
however I get lost using the quotes:
 
I tried numerous versions of:
 
i-1
system(paste(c('cmd /c c:\\pheno\\whap --file c:\\pheno\\smri --alt, i,  
--perm 500', sep= )), intern=TRUE)
 
However no luck! I would be gratefull for any help.
 
Thanks,
 
Marco

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] help a newbie with a loop

2006-07-03 Thread Boks, M.P.M.

 
Hi,
 
I am new in R and stumbled on a problem my (more experienced) friends
can not help with with. Why isnt this code working?
 
The function is working, also with the loop and the graph appears, 

only when I build another loop around it  (for different values of p) ,
R stays in a loop?

Can't it take more then 2 loops in one program?

 
powerb-function(x,sp2,a,b,b1,m)
{   sx-(sum(x^2)-(sum(x)^2)/length(x))/length(x)
n0-ceilingqnorm(1-(a/2))+qnorm(1-b))/b1)^2)*(((m+1)/m)*sp2/sx))
repeat
{
n1-ceilingqt(1-(a/2),n0-4)+qt(1-b,n0-4))/b1)^2)*(((m+1)/m)*sp2/sx))
if(n0==n1) break
n0-n1
}
return(c(sx,n1))
}

x-rnorm(1000,0,1)
x-x[order(x)]
 
res-matrix(0,1000,2)
 

#use the function and plot  for different values of ind and p 
for ( p in c(0.05,0.10,0.15,0.20,0.25,0.30,0.40,0.50)) 
{  risk-p*(2-p)
nonrisk-(1-p)^2
m-nonrisk/risk
 
for (ind in 1:500)
{res[ind,]-powerb(x[c(1:(500-ind),(500+ind):1000)],4,0.05,0.20,0.1,m)}
 
plot(res[,1],res[,2],type=p,ylab=n,xlab=var(x),main=b=0.1,power=0
.80,alpha=0.05,dominant met p=0.25)} 

 
 
 I would appreciate the help,
 
Marco
 

MPM Boks, MD PhD,

Department of Psychiatry, B01.206

University Medical Centre Utrecht,

PO box 85500, 3508 GA Utrecht

The Netherlands.

Tel: +31 30 2506370

Fax: +31 30 2505509

Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 

 

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html