[R] pairwise.t.test vs. t. test

2006-09-07 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Hi,

If I set the p.adjust=none, does it meant that the output p values from the 
pairwise.t.test will be the same as those from individual t.tests (set 
var.equal=T, alternative=t)?

I actually got different p values from the two tests. See below. Is it supposed 
to be this way?

Thanks
Johnny

 x
 [1] 61.6 52.7 61.3 65.2 62.8 63.7 64.8 58.7 44.9 57.0 64.3 55.1 50.0 41.0
[15] 43.0 45.9 52.2 45.5 46.9 31.6 40.6 44.8 39.4 31.0 37.5 32.6 23.2 34.6
[29] 38.3 38.1 19.5 21.2 15.8 33.3 28.6 25.8
 Grp
 [1] Yng Yng Yng Yng Yng Yng Yng Yng Yng Yng Yng Yng Med Med Med Med Med Med
[19] Med Med Med Med Med Med Old Old Old Old Old Old Old Old Old Old Old Old
Levels: Yng Med Old
  pairwise.t.test(x=x,g=Grp,p.adjust.method=none)

Pairwise comparisons using t tests with pooled SD 

data:  x and Grp 

Yng Med
Med 1.0e-06 -  
Old 2.0e-12 2.6e-05

P value adjustment method: none 


 t.test(x=x[1:12],y=x[25:36],var.equal=T, alternative=t)

Two Sample t-test

data:  x[1:12] and x[25:36] 
t = 10.5986, df = 22, p-value = 4.149e-10
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval:
 24.37106 36.22894 
sample estimates:
mean of x mean of y 
 59.34167  29.04167 

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] meta characters in file path

2006-08-04 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Thanks. I tried them, it works for most of those characters except * and ?. 

Does regular expression work in file names in windows? e.g. I have a 
machine-generated file named 021706 matrix#1479 @50.csv, of which 1479 is 
kinda random. Will I be able to match 1479 with some sort of wild card 
chars?

Thanks
Johnny

-Original Message-
From: Tony Plate [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 03, 2006 3:42 PM
To: Li,Qinghong,ST.LOUIS,Molecular Biology
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] meta characters in file path


What is the problem you are having?  Seems to work fine for me running 
under Windows2000:

  write.table(data.frame(a=1:3,b=4:6), file=@# x.csv, sep=,)
  read.csv(file=@# x.csv)
   a b
1 1 4
2 2 5
3 3 6
  sessionInfo()
Version 2.3.1 (2006-06-01)
i386-pc-mingw32

attached base packages:
[1] methods   stats graphics  grDevices utils datasets
[7] base

other attached packages:
  XML
0.99-8
 

Li,Qinghong,ST.LOUIS,Molecular Biology wrote:
 Hi,
 
 I need to read in some files. The file names contain come meta characters 
 such as @, #, and white spaces etc, In read.csv, file= option, is there any 
 way that one can make the function to recognize a file path with those 
 characters?
 
 Thanks
 Johnny
 
   [[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
 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.


Re: [R] meta characters in file path

2006-08-04 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
thanks Prof Ripley. dir() returns the path with full names (wildcards replaced) 
that are exactly what I need.



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Prof Brian Ripley
Sent: Friday, August 04, 2006 12:27 PM
To: Li,Qinghong,ST.LOUIS,Molecular Biology
Cc: r-help@stat.math.ethz.ch; Tony Plate
Subject: Re: [R] meta characters in file path


On Fri, 4 Aug 2006, Li,Qinghong,ST.LOUIS,Molecular Biology wrote:

 Thanks. I tried them, it works for most of those characters except * 
 and ?.

Those are not valid characters in Windows file paths
(/   * :   ? \ | are invalid in file or dir names).

 Does regular expression work in file names in windows? 

No, and I think you may mean wildcards (which is what work on the command 
line).

 e.g. I have a machine-generated file named 021706 matrix#1479 @50.csv, 
 of which 1479 is kinda random. Will I be able to match 1479 with 
 some sort of wild card chars?

Yes, use dir(), with regexp pattern patching to find the name(s) you 
want.  glob2rx() might be useful here.

 Thanks
 Johnny
 
 -Original Message-
 From: Tony Plate [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 03, 2006 3:42 PM
 To: Li,Qinghong,ST.LOUIS,Molecular Biology
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] meta characters in file path
 
 
 What is the problem you are having?  Seems to work fine for me running 
 under Windows2000:
 
   write.table(data.frame(a=1:3,b=4:6), file=@# x.csv, sep=,)
   read.csv(file=@# x.csv)
a b
 1 1 4
 2 2 5
 3 3 6
   sessionInfo()
 Version 2.3.1 (2006-06-01)
 i386-pc-mingw32
 
 attached base packages:
 [1] methods   stats graphics  grDevices utils datasets
 [7] base
 
 other attached packages:
   XML
 0.99-8
  
 
 Li,Qinghong,ST.LOUIS,Molecular Biology wrote:
  Hi,
  
  I need to read in some files. The file names contain come meta characters 
  such as @, #, and white spaces etc, In read.csv, file= option, is there any 
  way that one can make the function to recognize a file path with those 
  characters?
  
  Thanks
  Johnny
  
  [[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
  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.
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
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] meta characters in file path

2006-08-03 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Hi,

I need to read in some files. The file names contain come meta characters such 
as @, #, and white spaces etc, In read.csv, file= option, is there any way that 
one can make the function to recognize a file path with those characters?

Thanks
Johnny

[[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
and provide commented, minimal, self-contained, reproducible code.


[R] multinomial test

2006-02-22 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Hi All,

What is the R function for computing multinomial distribution, e.g. f(2,1,3; 
2/9, 1/6, 11/18, 6)? 

That is, a total of 6 trials, event 1's p1=2/9, x1=2, event 2's p2=1/6, x2=1, 
and event 3's p3=11/18, x3=3.

thanks,
Johnny

[[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


Re: [R] multinomial test

2006-02-22 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Thanks Jim. I think my previous posting wasn't clear enough. What I try to do 
is to compute the probability: f(2,1,3; 2/9, 1/6, 11/18, 6). (If we compute by 
hand, it is 0.1127). What is the R funtion for doing that?
 
I know for binomial tests, there is a function called binom.test. But for 
multinomial events, is there a similar function in R? 
 
thanks
Johnny

-Original Message-
From: jim holtman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 5:33 PM
To: Li,Qinghong,ST.LOUIS,Molecular Biology
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] multinomial test


?sample
 
sample(1:3, 6, TRUE, prob=c(2/9, 1/6, 11/18))


 
On 2/22/06, Li,Qinghong,ST.LOUIS,Molecular Biology  [EMAIL PROTECTED] wrote: 

Hi All,

What is the R function for computing multinomial distribution, e.g. f(2,1,3; 
2/9, 1/6, 11/18, 6)? 

That is, a total of 6 trials, event 1's p1=2/9, x1=2, event 2's p2=1/6, x2=1, 
and event 3's p3=11/18, x3=3.

thanks,
Johnny

   [[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





-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What the problem you are trying to solve? 


[[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


Re: [R] multinomial test

2006-02-22 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Thanks. That is what I try to find. You know what, I have tried ?multinomial, 
but it didn't recognize. It is case sensitive I guess.

Johnny

-Original Message-
From: Berton Gunter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 5:44 PM
To: 'jim holtman'; Li,Qinghong,ST.LOUIS,Molecular Biology
Cc: r-help@stat.math.ethz.ch
Subject: RE: [R] multinomial test


Qinghong:

R Has an extensive Help system which you should learn to use.

help.search('multinomial') 
?Multinomial

Jim: sample() is wrong -- it gives random samples, not probabilities.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of jim holtman
 Sent: Wednesday, February 22, 2006 3:33 PM
 To: Li,Qinghong,ST.LOUIS,Molecular Biology
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] multinomial test
 
 ?sample
 
 sample(1:3, 6, TRUE, prob=c(2/9, 1/6, 11/18))
 
 
 
 On 2/22/06, Li,Qinghong,ST.LOUIS,Molecular Biology 
 [EMAIL PROTECTED] wrote:
 
  Hi All,
 
  What is the R function for computing multinomial distribution, e.g.
  f(2,1,3; 2/9, 1/6, 11/18, 6)?
 
  That is, a total of 6 trials, event 1's p1=2/9, x1=2, event 
 2's p2=1/6,
  x2=1, and event 3's p3=11/18, x3=3.
 
  thanks,
  Johnny
 
 [[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
 
 
 
 
 --
 Jim Holtman
 Cincinnati, OH
 +1 513 646 9390
 
 What the problem you are trying to solve?
 
   [[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


__
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


[R] write.table call

2005-10-31 Thread Li,Qinghong,ST.LOUIS,Molecular Biology

Hi,

I use write.table() to write a file to an external xls file. the column names 
left-shift one position in output file. I check with col.names() row.names(), 
the file is fine. How to prevent the shifting? 

I71 I111I304I307I305I306I114I72 
AFFX-BioB-5_at  6.66435 6.7878075.3359625.2501636.47423 
5.8821045.9651096.591687195 
AFFX-BioB-M_at  6.1632275.9654274.6655692.743531
6.0972445.77137 5.1136836.314003982 

Thanks,
Johnny

[[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


[R] comment code

2005-10-27 Thread Li,Qinghong,ST.LOUIS,Molecular Biology
Hi All,

In R, can one comment out a block of code at once instead of using # one line 
at a time? Say, in SAS, one can use /**/ to comment out many lines.

Thanks,
Johnny

[[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