[R] R graphics display window

2007-08-17 Thread Felipe Carrillo
Hi all:
How can the R graphics window be customized
programmatically? Either minimized,maximized or change
the size of the default that ships with R.
Thanks

 Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080

__
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] Creating an instance of R from MS Access?

2007-07-30 Thread Felipe Carrillo
Hi all:
Does anyone know if it's at all possible to create a
connection to R from MS access? For example, if I have
a table and want to export it to R,generate a graph in
R and import it back to MS access. I can do this with
sigmaPlot and other graphic programs but just
wondering if it can be done with R. Thanks



 Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080



  


__
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] ggplot2 axis color

2007-07-24 Thread Felipe Carrillo
Hi:
Does anyone have an idea on how to color the axis and
labels using ggplot2? This is what I got:

library(ggplot2)
 p - qplot(total_bill, tip, data = tips)
 NewPlot-  p + geom_abline(slope=c(0.1,0.15,0.2),
colour=c(red,blue,yellow),size=c(2,5,2))
NewPlot + geom_smooth(colour=green,
size=3,linetype=3)
NewPlot$background.fill-cornsilk 
NewPlot$background.colour - blue
NewPlot$axis.colour-red  ? it doesn't do it
Thanks

 Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080



  


__
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] About infinite value

2007-07-23 Thread Mendiburu, Felipe \(CIP\)
I think that the best thing is to work in logarithmic way, to avoid the 
limitations of the CPU. 
If y = 10^400, to do y=400*log(10), to change all you formulate to the 
logarithmic way and the final result to apply the antilogarithm. 
 
Felipe de Mendiburu. 
Professor of statistic 
Agrarian National University -La Molina - PERU 



De: [EMAIL PROTECTED] en nombre de arigado
Enviado el: lun 23/07/2007 4:17
Para: r-help@stat.math.ethz.ch
Asunto: [R] About infinite value




Hi everyone

I have a problem about infinite.
If I type 10^308, R shows 1e+308
When I type 10^309, R shows Inf
So, we know if a value is large than 1.XXXe+308, R will show Inf
How can i do let the value, like 10^400 ,typed in R to show the word
1e+400 not Inf

--
View this message in context: 
http://www.nabble.com/About-infinite-value-tf4128557.html#a11740491
Sent from the R help mailing list archive at Nabble.com.

__
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] change text labels on a dendrogram

2007-07-23 Thread Mendiburu, Felipe \(CIP\)
Dear Marcela.
 
In the data, if column 1 has the names:
 
rownames(data) -data [, 1]
data - date [, - 1] 
 
now, to make a dendrogram
greetings. 
 
Felipe de Mendiburu. 
Professor of statistic 
Agrarian National University -La Molina - PERU 
 



De: [EMAIL PROTECTED] en nombre de Ana Marcela Florez Rueda
Enviado el: lun 23/07/2007 9:09
Para: r-help@stat.math.ethz.ch
Asunto: [R] change text labels on a dendrogram



 Hi all:


I already made a dendrogram, I want to change the labels; In my data set
there is one column with text that I want to set as the labels, any one can
tellme how can  I do it?


Thanks,


Ana Marcela

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


[R] Saving a dataset permanently in R

2007-07-18 Thread Felipe Carrillo
HI:
I'm still struggling with datasets, the more I read
about it the more confussed I get. This is the
scenario... In R console|Edit|Data Editor, I can find
all the datasets available with the different
packages, So to create a new dataset in the R console
I use the following commands to create an empty data
frame.
My_Dataset - data.frame()
My_Dataset - edit(My_dataset)

The problem is that I can't copy my data into the
dataframe. Is there any suggestions as of how I can
transfer the data and how it can be saved so everytime
I open R the dataset would be available.?
Thanks

 Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080

__
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] LSD, HSD,...

2007-07-17 Thread Mendiburu, Felipe \(CIP\)
Dear Adrain,

You can see the library agricolae for the functions LSD.test, HSD.test, and 
Waller.test for Waller-Duncan. The criterion is that LSD is more used for few 
treatments and HSD for many treatments (more than 5) the test of Waller is 
Bayes and minimizes the two types of error (I or II). In experiment with 
clones, we prefer Waller-Duncan.

Felipe de Mendiburu
Statistician.
International Potato Center Lima-Peru

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Adrian J. Montero
Calvo
Sent: Monday, July 16, 2007 2:52 AM
To: r-help@stat.math.ethz.ch
Subject: [R] LSD, HSD,...


Hi,
I'm designing a experiment in order to compare the growing of 
several clones of a tree specie. It will be a complete randomized block 
design. How can I decide what model of mean comparision to choose? LSD, 
HSD,TukeyHSD,  Duncan,...?  Thanks in advance

__
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] How to load a dataset

2007-07-15 Thread Felipe Carrillo
Hi:
  Since I didn't get any answers, I'll refresh my question.
  I have a dataset called Chinook Run saved in Excel and I want it to be 
loaded everytime R starts, so I can call it with a statement like the one below:
  qplot(color, Year/Forklength, data = Chinook Run)
  I wonder how can I do that.
  I went to the rprofile.site and copied the path to my dataset there and it 
seems to work
  but I am wondering if that's how's done.
  Felipe
  



 Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080

   
-

[[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] How to get weekly Covariance with R

2007-07-12 Thread Felipe Carrillo
Hi: I am trying to migrate from Systat to R but I am facing my first
 challenge. While I easily can get weekly co-variance for my data, I can't
 seem to acomplish this with R ( I can't figure out how is done) If
 interested in looking a sample of my data, please check the data
 below. In Systat from Week 28 I get a covariance of 1055 fish.
  Thanks in advance
   
Fish Passage  Week number Weekly Covariance0  26
 00  27 00  27  0  27  0  27  0  27 
 0  27  0  27  0  28 10550  28  71  28  
132  28  223  28  224  28  218  28  228  29 
 224  29  488  29  525  29  80  29  417  29 
 82  29  413  30  373  30  914  30  213 
 30  651  30  521  30  979  30  177  31 
 604  31  824  31  1190  31  926  31  1257  31  
1071  31  1709  32  1166  32  704  32  
1424  32  2586  32  1163  32  647  32  



 Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080

   
-


[[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] type III ANOVA for a nested linear model

2007-07-12 Thread Mendiburu, Felipe \(CIP\)
Dear Carsten

In this test, factor B would be representing to a factor of block or repetition 
according to as the levels of A, B, and C are in the data. Factor C this nested 
in A, then the model should include: B, A and C nested in A, the difference it 
is the error.

Model:
B   1
A   2
C(A)6
Error   (2+6)*1 = 8
Total

mydata-read.table(mydata.txt,header=T)
mydata[,1]- as.factor(mydata[,1])
mydata[,2]- as.factor(mydata[,2])
mydata[,3]- as.factor(mydata[,3])
model - aov(resp ~ B + A + C/A, mydata)
summary(model)
Df Sum Sq Mean Sq F valuePr(F)
B1 915.21  915.21 89.6476 1.274e-05 ***
A2  33.12   16.56  1.6223   0.25621
C6 199.50   33.25  3.2570   0.06316 .  
Residuals8  81.67   10.21

Best regards,

Felipe de Mendiburu
Statistician



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Carsten Jaeger
Sent: Tuesday, July 10, 2007 6:15 AM
To: R help list
Subject: [R] type III ANOVA for a nested linear model


Hello,

is it possible to obtain type III sums of squares for a nested model as
in the following:

lmod - lm(resp ~ A * B + (C %in% A), mydata))

I have tried

library(car)
Anova(lmod, type=III)

but this gives me an error (and I also understand from the documentation
of Anova as well as from a previous request
(http://finzi.psych.upenn.edu/R/Rhelp02a/archive/64477.html) that it is
not possible to specify nested models with car's Anova).

anova(lmod) works, of course.

My data (given below) is balanced so I expect the results to be similar
for both type I and type III sums of squares. But are they *exactly* the
same? The editor of the journal which I'm sending my manuscript to
requests what he calls conventional type III tests and I'm not sure if
can convince him to accept my type I analysis.

R mydata
  A B C  resp
1 1 1  1 34.12
2 1 1  2 32.45
3 1 1  3 44.55
4 1 2  1 20.88
5 1 2  2 22.32
6 1 2  3 27.71
7 2 1  6 38.20
8 2 1  7 31.62
9 2 1  8 38.71
102 2  6 18.93
112 2  7 20.57
122 2  8 31.55
133 1  9 40.81
143 1 10 42.23
153 1 11 41.26
163 2  9 28.41
173 2 10 24.07
183 2 11 21.16

Thanks a lot,

Carsten

__
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] How to get weekly Co-Variance

2007-07-11 Thread Felipe Carrillo
Hi: I am trying to migrate from Systat to R but I am facing my first challenge. 
While I easily can get weekly co-variance for my data, I can't seem to 
acomplish this with R ( I can't figure out how is done) If interested in 
looking a sample of my data, please check the Excel attachment. In Systat from 
Week 28 I get a covariance of 1055 fish.
  Thanks in advance


Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080

   
-
__
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] How to plot two variables using a secondary Y axis

2007-07-10 Thread Felipe Carrillo
  Date  Fo  Co6/27/2007  57.1  13.96/28/2007  57.7  14.3
6/29/2007  57.8  14.36/30/2007  57  13.97/1/2007  57.1  13.9
7/2/2007  57.2  14.07/3/2007  57.3  14.17/4/2007  57.6  14.2
7/5/2007  58  14.47/6/2007  58.1  14.57/7/2007  58.2  14.67/8/2007  
58.4  14.77/9/200758.7
14.8
   
  Hello all:
  I am a newbie to R, and I was wondering how can I plot the Temperature values 
above using Lattice or ggplot2 code. I want Date(X axis), Degrees F(Y axis) and 
Degrees C( on a secondary Y axis). 
  Thanks
   
   
   
   
   
   
   
   

   
-

[[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] How to activate the R commands in SciViews

2007-06-20 Thread Felipe Carrillo
Please help, I have SciViews(svGUI) and Rcmdr but when the SciViews Console 
opens the R commander menu don't work. Any ideas anybody?
 
-
8:00? 8:25? 8:40?  Find a flick in no time

[[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] Call-Tips

2007-06-16 Thread Felipe Carrillo
Hi: I am brand new to this group ( and To Tinn-R), so I have my first question: 
How do I turn on the Call-Tips? I went through the help and I have installed 
the SciViews but still can't get it to work. I would really appreciate your 
help.
 
-
TV dinner still cooling?

[[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] R's Spearman

2007-05-31 Thread Mendiburu, Felipe \(CIP\)
Dear Ray,

The R's Spearman calculated by R is correct for ties or nonties, which is not 
correct is the probability for the case of ties. I send to you formulates it 
for the correlation with ties, that is equal to R. 

Regards,

Felipe de Mendiburu
Statistician


# Spearman correlation rs with ties or no ties
rs-function(x,y) {
d-rank(x)-rank(y)
tx-as.numeric(table(x))
ty-as.numeric(table(y))
Lx-sum((tx^3-tx)/12)
Ly-sum((ty^3-ty)/12)
N-length(x)
SX2- (N^3-N)/12 - Lx
SY2- (N^3-N)/12 - Ly
rs- (SX2+SY2-sum(d^2))/(2*sqrt(SX2*SY2))
return(rs)
}

# Aplicacion
 cor(y[,1],y[,2],method=spearman)
[1] 0.2319084
 rs(y[,1],y[,2])
[1] 0.2319084



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Raymond Wan
Sent: Monday, May 28, 2007 10:29 PM
To: r-help@stat.math.ethz.ch
Subject: [R] R's Spearman



Hi all,

I am trying to figure out the formula used by R's Spearman rho (using 
cor(method=spearman)) because I can't seem to get the same value as by 
calculating by hand.  Perhaps I'm using cor wrong, but I don't know 
where.  Basically, I am running these commands:

  y=read.table(file=tmp,header=TRUE,sep=\t)
  y
   IQ Hours
1 106 7
2  86 0
3  9720
4 11312
5 12012
6 11017
  cor(y[1],y[2],method=spearman)
   Hours
IQ 0.2319084

[it's an abbreviated example of one I took from Wikipedia].  I 
calculated by hand (apologies if the table looks strange when pasted 
into e-mail):

  IQHoursrank(IQ)  rank(hours)diffdiff^2
110673 2 11
2 8601 1 00
3 9720   2 6-416
411312   5 3.5 1.52.25
512012   6 3.5 2.56.25
611017   4 5-11
  26.5
   
  rho=0.242857

where rho = (1 - ((6 * 26.5) / 6 * (6^2 - 1))).  I kept modifying the 
table and realized that the difference in result comes from ties.  i.e., 
if I remove the tie in rows 4 and 5, I get the same result from both cor 
and calculating by hand.  Perhaps I'm handling ties wrong...does anyone 
know how R does it or perhaps I need to change how I'm using it?

Thank you!

Ray

__
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] creating a multivariate set of variables with givenintercorrelations

2007-05-19 Thread Mendiburu, Felipe \(CIP\)
Dear Dimitri,
 
if you wish single the correlations, can use the following script:
 
a-1:10
b- rnorm(10)
c- rbinom(10,8,0.3)
d- rpois(10,8)
corr-cor( cbind(a,b,c,d) )
round(as.dist(corr),2) # or only as.dist(corr)
  a  b  c
b  0.07
c  0.19 -0.26  
d -0.16 -0.13 -0.41


regards,
 
Felipe

Hi!
I was wondering if there is a package in R that allows one to create a
multivariate data set with pre-specified intercorrelations among
variables, e.g., a set of 4 variables (with a length of N each), such
that the correlations between variables are:

 a b c d
a   1 r1r2r3
b  1 r4r5
c 1 r6
d 1

Thank you very much!
Dimitri Liakhovitski

__
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] 'substitute' question

2007-03-13 Thread Mendiburu, Felipe \(CIP\)
Dear Renko

To modify the script

plot(x,y)
r2-summary(lm1)$r.squared*100
# label
R2text - substitute(paste(R^2, = ,r2),list(r2=r2))
text(-1,1,R2text, col=red) # To see of the coordinates of the graph.

Grettings

Felipe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of remko duursma
Sent: Tuesday, March 13, 2007 8:02 AM
To: r-help@stat.math.ethz.ch
Subject: [R] 'substitute' question



# I use this code to label a graph with the R2:

# graph
x - rnorm(100)
y - x + rnorm(100)
lm1 - lm(y~x)
plot(x,y)

# label
R2text - substitute(paste(R^2, = ,r2),list(r2=r2))
text(1,-3,R2text, col=red)

# i have modified this a bit, so that i have a vector with other labels, 
each of which
# will be labelled on the graph. Example:
texts - c(And the R2 is, R2text)
x - c(-2,-2)
y - c(2,1)
for(i in 1:length(texts))text(x[i],y[i],texts[i],pos=4, col=blue)

# As you can see the label R2 = 48.7 remains at paste(R^2,  = , 48.7)
# What to do?



Thanks for your help,

Remko



..-~-.-~-.-~-.-~-.-~-.-~-.-~-.-~-.-~-
Remko Duursma
Post-doctoral researcher
Dept. Forest Ecology
University of Helsinki, Finland

_
With tax season right around the corner, make sure to follow these few 
simple tips.

__
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] Package RODBC

2007-03-07 Thread Mendiburu, Felipe \(CIP\)
Dear Alberto,

It is better to assign a name to an area of data and not to use 
the name of the sheet, because this can have graphs and other data. 
If you this interested can see:
http://tarwi.lamolina.edu.pe/~fmendiburu/Rsolutions.htm 

I hope that this also helps,
Felipe.

-Original Message-
From: Wolfgang Raffelsberger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 4:50 AM
To: Mendiburu, Felipe (CIP)
Cc: Alberto Monteiro; r-help@stat.math.ethz.ch
Subject: Re: [R] Package RODBC


Dear Alberto,

please note that special characters (eg a space character) in the Excel 
sheet names mess up the simple way of querying provided by sqlFetch.

If you have a regular case of all sheets like Sheet1:

plan1 - sqlFetch(channel,Sheet1)   # should work


But if you have Sheet 1 ( similar..)  you have to use the command 
sqlQuery(), which means that you have to write a proper SQL query as 2nd 
argument that follows proper SQL syntax (starting with SELECT, 
etc...). If I wanted to combine this with sheet-names already read in 
variables/vectors I concatenate this into a single stringsimilar to your 
2nd code variant ... Of course you could also use grep() to search the 
position of a given sheet-name (the order of the sheets may be different 
that within Excel).

What you get with

plan1[,1]

depends on what you're reading.  In case that the 1st column is read as 
string, this is read by default as factor with n levels.  You can simply 
convert it using as.character() ...

Hope this helps,
Wolfgang

Mendiburu, Felipe (CIP) a écrit :
 Dear Alberto,

 channel - odbcConnectExcel(test.xls)
 name1 - tables[1, TABLE_NAME] # the name1 is Sheet1$
 it must be: 
 name1 - Sheet1
 plan1 - sqlFetch(channel, name1) is ok
 or
 plan1 - sqlFetch(channel, Sheet1)

 Regards,

 Felipe

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Alberto Monteiro
 Sent: Tuesday, March 06, 2007 9:37 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] Package RODBC


 I have some questions about the RODBC package.

   library(RODBC)  # required for those who want to repeat these lines

 1st, I noticed that the following sequence does not work:

   channel - odbcConnextExcel(test.xls)
   tables - sqlTables(channel) 
   name1 - tables[1, TABLE_NAME]  # this should be the name
   plan1 - sqlFetch(channel, name1)  # bang!
   odbcClose(channel)

 However, I can circumvent this with:

   channel - odbcConnextExcel(test.xls)
   tables - sqlTables(channel) 
   name1 - tables[1, TABLE_NAME]  # this should be the name
   plan1 - sqlQuery(channel, sprintf(select * from [%s], name1))  # ok
   odbcClose(channel)

 2nd, it seems that only pure strings (which are not links to
 strings) and numerical values are correctly fetched or selected.
 Is this a bug?

 3rd, when do something like plan1[,1] a weird message about Levels
 appear. What is that?

 Alberto Monteiro


   


-- 

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
. . . . .

Wolfgang Raffelsberger, PhD
Laboratoire de BioInformatique et Génomique Intégrative
IGBMC
1 rue Laurent Fries,  67404 Illkirch  Strasbourg,  France
Tel (+33) 388 65 3300 Fax (+33) 388 65 3276
[EMAIL PROTECTED]

__
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] how to apply functions to unbalanced data in long format byfactors......cant get by or aggregate to work

2007-03-07 Thread Mendiburu, Felipe \(CIP\)
Dear Alan,
 
I think that podria to be of utility the function tapply.stat () of the package 
agricolae.
see ?tapply.stat
Regards,
Felipe.
 
for example:
library(agricolae)
attach(mydata)
set1-tapply.stat(mydata[,2:5],Y,median)
set2-tapply.stat(time,Y,function(x) median(x))
set3-tapply.stat(mydata[,c(2,3)],Y,function(x) median(x))
set2
   timeY
1 120hr 14.94159
2  24hr 14.81914
set3
   time treatmentY
1 120hr   control 15.31974
2 120hr   trt 14.82851
3  24hr   control 15.03627
4  24hr   trt 14.70249




From: [EMAIL PROTECTED] on behalf of ALAN SMITH
Sent: Wed 3/7/2007 6:25 PM
To: r-help@stat.math.ethz.ch
Subject: [R] how to apply functions to unbalanced data in long format 
byfactors..cant get by or aggregate to work



Hello R users,

Problem...I do not understand how to use aggregate,by, or the
appropriate apply to perform a function on data with more than one
factor on unbalanced data...
I have a data frame in the long format that does not contain balanced
data. The ID is a unique identifier corresponding to the experimental
unit that will later be examined by ANOVA, T-tests etc. Y is the data
generated from the experiment.  The factors represent the differences
between each sample or run measured.

str(mydata)  ### sample of table at bottom of email ###
'data.frame':   129982 obs. of  6 variables:
 $ ID: num  7 7 7 7 7 7 8 8 8 8 ...
 $ time : Factor w/ 2 levels 120hr,24hr: 1 1 1 1 2 2 2 1 1 1 ...
 $ treatment: Factor w/ 2 levels control,trt: 1 1 1 2 2 1 1 2 1 1 ...
 $ expREP   : Factor w/ 3 levels expREP1,expREP2,..: 1 1 1 3 1 1 1 1 2 2 ...
 $ techREP  : Factor w/ 3 levels techREP1,techREP2,..: 3 2 1 1 1 3
1 3 3 2 ...
 $ Y : num  14.4 14.1 14.2 13.8 14.1 ...

Could someone please help with doing something like the following
1. I would like to find the median for each unique combination of
factors using the data in the   long format (like finding the median
of a single column of data).
2. Create a new column where the median is repeated for the number of
rows of the unique factor combination
3. I would like to learn the most efficient way to do this because I
want to avoid recreating the table from scratch with many commands
like the series below. I will have to perform this operation on many
different data sets some, with many more factors then this example.

### help me learn to use an apply or other command that will do the
following #
m0-mydata$cpdID[mydata$time==24hr  mydata$treatment==control 
mydata$expREP==expREP1  mydata$techREP==techREP1]
m1-mydata$Y[mydata$time==24hr  mydata$treatment==control 
mydata$expREP==expREP1  mydata$techREP==techREP1]
m2-median(m1)
m3-cbind(ID=m0,time=rep(24hr,length(m1)),
treatment=rep(control,length(m1)), expREP=rep(expREP1,length(m1)),
techREP=rep(techREP1,length(m1)),Y=m1,Y50=rep(m2,length(m1)))
# I would like to avoid writing the above hundreds of times ##

I am able to reshape into wide format and then find the column
medians. However restacking the data and regenerating the factors
becomes very very messy on data sets with 150 columns.  I am able to
preform this analysis is SAS easily using BY, but I would like to know
how to do it in R.


I have tried these commands in a number of different variations with
no luck and similar error messages
 test1-aggregate(mydata[,-1],
list(mydata$time,mydata$treatment,mydata$expREP,mydata$techREP)
,median, na.rm=T)
Error in median.default(X[[1]], ...) : need numeric data ### Y in numeric

test1-by(mydata[,-1],
list(mydata$time,mydata$treatment,mydata$expREP,mydata$techREP)
,median, na.rm=T)
Error in median.default(data[x, ], ...) : need numeric data

Thanks
Alan
winXP R 2.4.1


#Example data frame##
mydata-as.data.frame(structure(list(cpdID = c(7, 7, 7, 7, 7, 7, 8, 8,
8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23,
23, 23, 23, 23, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47), time = structure(as.integer(c(1,
1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2,
1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2,
1, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2

Re: [R] Package RODBC

2007-03-06 Thread Mendiburu, Felipe \(CIP\)
Dear Alberto,

channel - odbcConnectExcel(test.xls)
name1 - tables[1, TABLE_NAME] # the name1 is Sheet1$
it must be: 
name1 - Sheet1
plan1 - sqlFetch(channel, name1) is ok
or
plan1 - sqlFetch(channel, Sheet1)

Regards,

Felipe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Alberto Monteiro
Sent: Tuesday, March 06, 2007 9:37 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Package RODBC


I have some questions about the RODBC package.

  library(RODBC)  # required for those who want to repeat these lines

1st, I noticed that the following sequence does not work:

  channel - odbcConnextExcel(test.xls)
  tables - sqlTables(channel) 
  name1 - tables[1, TABLE_NAME]  # this should be the name
  plan1 - sqlFetch(channel, name1)  # bang!
  odbcClose(channel)

However, I can circumvent this with:

  channel - odbcConnextExcel(test.xls)
  tables - sqlTables(channel) 
  name1 - tables[1, TABLE_NAME]  # this should be the name
  plan1 - sqlQuery(channel, sprintf(select * from [%s], name1))  # ok
  odbcClose(channel)

2nd, it seems that only pure strings (which are not links to
strings) and numerical values are correctly fetched or selected.
Is this a bug?

3rd, when do something like plan1[,1] a weird message about Levels
appear. What is that?

Alberto Monteiro

__
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] lattice histogram

2007-03-04 Thread Mendiburu, Felipe \(CIP\)
Steve,

it says resp  - rnorm(200) must be resp  - rnorm(100) 

regards

Felipe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of steve
Sent: Sunday, March 04, 2007 8:58 AM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] lattice histogram


Hi,

When I tried this the groups had sizes 36 30 34 as expected, but
the annotations n =  were 68 72 60 - twice as large. I don't 
understand why.

Steve

Renaud Lancelot wrote:
 Here is an example using the grid package to annotate the graphs:
 
 library(lattice)
 library(grid)
 resp  - rnorm(200)
 group - sample(c(G1, G2, G3), replace = TRUE, size = 100)
 histogram(~ resp | group,
   panel = function(x, ...){
 std - round(sd(x), 2)
 n - length(x)
 m - round(mean(x), 2)
 panel.histogram(x, ...)
 x1 - unit(1, npc) - unit(2, mm)
 y1 - unit(1, npc) - unit(2, mm)
 grid.text(label = bquote(n == .(n)), x = x1, y = y1, just = right)
 grid.text(label = bquote(hat(m) == .(m)), x = x1, y = y1 - unit(1,
 lines), just = right)
 grid.text(label = bquote(hat(s) == .(std)), x = x1, y = y1 -
 unit(2, lines), just = right)
 })

__
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] significant anova but no distinct groups ?

2007-03-02 Thread Mendiburu, Felipe \(CIP\)
You can use the LSD.test or waller.test of the package agricolae that less 
conservatives than tukey. 



From: [EMAIL PROTECTED] on behalf of Frederic Jean
Sent: Fri 3/2/2007 4:52 PM
To: [EMAIL PROTECTED]
Subject: [R] significant anova but no distinct groups ?



Dear all,

I am studying a dataset using the aov() function.

The independant variable 'cds' is a factor() with 8 levels and here is 
the result in studying the dependant variable 'rta' with aov() :

 summary(aov(rta ~ cds))
 Df  Sum Sq Mean Sq F value  Pr(F)
cds  7 0.34713 0.04959  2.3807 0.02777
Residuals   92 1.91635 0.02083

The dependant variable 'rta' is normally distributed and variances are 
homogeneous.
But when studying the result with TukeyHSD, no differences in 'rta' 
are seen among groups of 'cds' :

 TukeyHSD(aov(rta ~ cds), which=cds)
   Tukey multiple comparisons of means
 95% family-wise confidence level

Fit: aov(formula = rta ~ cds)

$cds
  difflwrupr p adj
1-0 -0.1046092796 -0.4331100 0.22389141 0.9751178
2-0  0.0359991860 -0.1371359 0.20913425 0.9980970
3-0  0.0261665235 -0.1348524 0.18718540 0.9996165
4-0  0.0004502442 -0.1805448 0.18144531 1.000
5-0 -0.1438949939 -0.3104752 0.02268526 0.1422670
[...]
7-5  0.0621598639 -0.1027595 0.22707926 0.9386170
7-6  0.0256519274 -0.1757408 0.22704465 0.248

I tried a pairwise.t.test (holm correction) which also was not able to 
detect differences in 'rta' among groups of 'cds'
I've never been confronted to such a situation before : is it just a 
problem of power of the /a posteriori/ tests used ? Do I miss 
something important in basic stats or in R ?
How to highlight differences among 'cds' groups seen with aov() ?

Any help appreciated
Thanks in advance,

Fred J.

__
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] ordered matrix question

2007-02-27 Thread Mendiburu, Felipe \(CIP\)
Juan Pablo,

X is data.frame or matrix
X - X[order(X[,4]),]
options see help(order)

Felipe de Mendiburu

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Juan Pablo Fededa
Sent: Tuesday, February 27, 2007 12:47 PM
To: R-help@stat.math.ethz.ch
Subject: [R] ordered matrix question


Hi all,

Is there an easy way to generate an object wich will be the same matrix, but
ordered by de cfp value?
The data frame consists of numeric columns:
BlockXYcfpyfpID
0524244213.417957.184821091
055627065.3839049.5683726612
052831640.7894745.5737321753
0642432135.8173412.401344274
071643034.3591353.9449230775
0894362109.631583.1971603166
095813063.984523.3964520047
05069283.5139319.1054968568
047646491.6749199.1780894149
036442644.139322.06833436410

Thanks in advance,


Juan Pablo

[[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] Multiple conditional without if

2007-02-27 Thread Mendiburu, Felipe \(CIP\)
Dear matthias,

newmatrix = oldmatrix[ (oldmatrix[,5]==4  oldmatrix[,6]==1) , ]

Felipe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of bunny ,
lautloscrew.com
Sent: Tuesday, February 27, 2007 1:25 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Multiple conditional without if


Dear all,

i am stuck with a syntax problem.

i have a matrix which has about 500 rows and 6 columns.
now i want to kick some data out.
i want create a new matrix which is basically the old one except for all
entries which have a 4 in the 5 column AND a 1 in the 6th column.

i tried the following but couldn´t get a new matrix, just some wierd  
errors:

newmatrix=oldmatrix[,2][oldmatrix[,5]==4]oldmatrix[,2][oldmatrix[,6] 
==1]

all i get is:
numeric(0)

does anybody have an idea how to fix this one ?

thx in advance

matthias
[[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] Multiple conditional without if

2007-02-27 Thread Mendiburu, Felipe \(CIP\)
Matthias,

According to the logic,

New matrix which is basically the old one except for all
entries which have a 4 in the 5 column AND a 1 in the 6th column

newmatrix - oldmatrix[ (oldmatrix[,5]!=4  oldmatrix[,6]!=1) , ]

---

newmatrix - oldmatrix[ !(oldmatrix[,5]==4  oldmatrix[,6]==1) , ]

by,

Felipe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of bunny ,
lautloscrew.com
Sent: Tuesday, February 27, 2007 1:25 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Multiple conditional without if


Dear all,

i am stuck with a syntax problem.

i have a matrix which has about 500 rows and 6 columns.
now i want to kick some data out.
i want create a new matrix which is basically the old one except for all
entries which have a 4 in the 5 column AND a 1 in the 6th column.

i tried the following but couldn´t get a new matrix, just some wierd  
errors:

newmatrix=oldmatrix[,2][oldmatrix[,5]==4]oldmatrix[,2][oldmatrix[,6] 
==1]

all i get is:
numeric(0)

does anybody have an idea how to fix this one ?

thx in advance

matthias
[[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] predict.Arima question

2006-10-19 Thread Felipe Santos
Hi,

I am trying to forecast a model using predict.Arima

I found arima model for a data set: x={x1,x2,x3,...,x(t)}

arima_model = arima(x,order=c(1,0,1))

I am forecasting the next N lags using predict:

arima_pred = predict(arima_model,n.ahead = N, se.fit=T)

If I have one more point in my series, let's say x(t+1). I do not want to
recalibrate themodel, I just want to forecast the next N-1 lags  using the
same model for x={x1,x2,...x(t)} but without recalibrate arima.

How to do it using arima + predict.Arima ?

My problem is that I am trying to fit arima models by brute force ( trying
lots of combinations for p and q and chosing the best model by AIC and BIC )
I have a big time series and I am running calibration for some sub-sequence
and I trying to forecast some points. I repeat this process for the next
contiguous subsequence and try to forecast again, until the big series end.

Thanks
Felipe

[[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] Pairwise comparison after repeated measures ANOVA

2006-02-15 Thread Felipe Martínez-Pastor
I am analyzing some data obtained after measuring some parameters at
different times in samples obtained from many subjects. The model is
quite simple: aov(parameter ~ Time + Error(Subject/Time))

Now I want to make a pairwise comparison between the levels of Time.
However, I have not find how to do such a thing. I cannot use TukeyHSD
or pairwise.t.test, I supposse. Maybe using contrasts?

Could you aim me at some kind of information? All I have found is
information on ANOVA, but not how to compare the levels of the factors
afterwards.

Maybe I simply do not understand how this really works, my background is
not very deep in statistics.
Thank you.

Felipe

oOo
Felipe Martínez Pastor, Ph. D.
Ciencia y Tecnología Agroforestal
ETSIA-UCLM
Av. España s/n
02071-Albacete (Spain)
Phone: +34 967 599 200+2581
Fax:   +34 967 599 238+2081
Mobile: +34 687 365 362
e-mail: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
website: http://www.germplasm.all.at



-- 
Ningún investigador sin contrato.
Employment rights for Spanish junior researchers.
http://www.precarios.org

__
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] Discriminant analysis to select best treatment

2006-02-13 Thread Felipe Martínez-Pastor
Hi.
I have found stepclass {klaR}, which is similar to what I was looking
for. However, I take note of your advice en stepwise variable selection.
Greetings.

Felipe

Alexandre Santos Aguiar wrote:
 Em Dom 12 Fev 2006 16:10, Felipe Martínez-Pastor escreveu:
 --apparently-- not variable selection.
 
 About automatic variable selection one should read this: 
 http://www.pitt.edu/~wpilib/statfaq/regrfaq.html
 
 

-- 
Ningún investigador sin contrato.
Employment rights for Spanish junior researchers.
http://www.precarios.org

__
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] Discriminant analysis to select best treatment

2006-02-12 Thread Felipe Martínez-Pastor
I am designing an experiment to trial several analytic techniques on
samples submitted to different treatments. It has occurred to me that I
may use discriminant analysis to find out which kind of analysis best
reveals differences between treatments.

I have found the lda {MASS} in R. However, I am not sure if it is
adequate to my case, since it performs linear discriminant analysis but
--apparently-- not variable selection. In SAS I would use the STEPDISC
procedure, whose description is:
uses forward selection, backward elimination, or stepwise selection to
try to find a subset of quantitative variables that best reveals
differences among the classes.

I wonder if I could use lda or other function in that way. Maybe you
could point me to any resource (I am really new in discriminant analysis).

Thank you.

oOo
Felipe Martínez Pastor, Ph. D.
Ciencia y Tecnología Agroforestal
ETSIA-UCLM
Av. España s/n
02071-Albacete (Spain)
Phone: +34 967 599 200+2581
Fax:   +34 967 599 238+2081
Mobile: +34 687 365 362
e-mail: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]



-- 
Ningún investigador sin contrato.
Employment rights for Spanish junior researchers.
http://www.precarios.org

__
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] from Colombia - help

2005-12-20 Thread andres felipe
  Hi, my name is Andres Felipe Barrientos, I'm a student of Statistic and don't 
speak in english. En mi trabajo de grado necesito implementar la funcion 
smooth.spline y necesito saber con que tipo de spline trabaja (b-splines o 
naturales). 
  Ademas me gustaria saber cual es la base que se usa para encontrar estos 
splines, por ejemplo, cosenos, senos, polinomios entre otros Otra pregunta 
que tengo consiste en saber cual es la relacion que sostiene la funcion 
smooth.spline y ns Agradeciendo la atencion prestada y esperando una 
respuesta desde la universidad del valle, quien le escribe. Andres Felipe



-
 1GB gratis, Antivirus y Antispam
 Correo Yahoo!, el mejor correo web del mundo
 Abrí tu cuenta aquí
[[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] Are least-squares means useful or appropriate?

2005-09-20 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi.
My question was just theoric. I was wondering if someone who were using
SAS and R could give me their opinion on the topic. I was trying to use
least-squares means for comparison in R, but then I found some
indications against them, and I wanted to know if they had good basis
(as I told earlier, they were not much detailed).
Greetings.

Felipe

Spencer Graves wrote:
| Estimado Felipe:
|
|   If you provide a very simple example (as suggested in the posting
| guide, www.R-project.org/posting-guide.html), it would allow those of
| use who rarely use SAS to respond.  Try to think of the simplest
| possible toy data set and analysis that shows the difference between the
| SAS answer and the answer you get from a certain R function.  If you
| post something simple of that nature that someone can copy from your
| email into R and try other things in a minute or two, it will likely
| increase the speed and utility of a reply.
|
|   Buena Suerte,
|   spencer graves
|
-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMvzDEACgkQWtdQtNzjBl6NbgCfTg0hPZaSio9tO1iWrKHZY3Os
wzEAn3jdHwqqaHxG0OT8KR6kBlSZDPLp
=KtTd
-END PGP SIGNATURE-

__
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] Use of least-squares means, are they misleading?

2005-09-19 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi.
Sorry for sending this question twice, but I would really like to know
your opinion on this topic.

I have been reading about the (in)convenience of using least-squares
means (a. k. a. adjusted means) in multiple comparisons (I used to
resort to them when using SAS). I even read a post in this list warning
against them, but not giving much detail.

What is your opinion? Should I avoid using LSmeans for comparison (e.g.
after ANOVA)?

Greetings.

Felipe

__
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


-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMulV4ACgkQWtdQtNzjBl6QpwCfXYweOQWipAYY2ZZFiDYuAiwJ
LQYAnicmypM4yZhzMztRmZvppTZWes1z
=696Z
-END PGP SIGNATURE-

__
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] Use of least-squares means, are they misleading?

2005-09-19 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thank you, I will try there.
Felipe

Peter Flom wrote:
| Felipe
|
| I doubt you will get much response on this list, although it's an
| interesting question.  You might try asking it on another list.  Some
| that often have discussions of such topics are
|
| SAS-L
| EDSTAT-L and
| STAT-L
|
| Regards
|
| Peter
|
| Peter L. Flom, PhD
| Assistant Director, Statistics and Data Analysis Core
| Center for Drug Use and HIV Research
| National Development and Research Institutes
| 71 W. 23rd St
| http://cduhr.ndri.org
| www.peterflom.com
| New York, NY 10010
| (212) 845-4485 (voice)
| (917) 438-0894 (fax)
|
|
|
|Felipe [EMAIL PROTECTED] 09/19/05 6:39 AM 
|
| Hi.
| Sorry for sending this question twice, but I would really like to know
| your opinion on this topic.
|
| I have been reading about the (in)convenience of using least-squares
| means (a. k. a. adjusted means) in multiple comparisons (I used to
| resort to them when using SAS). I even read a post in this list warning
| against them, but not giving much detail.
|
| What is your opinion? Should I avoid using LSmeans for comparison (e.g.
| after ANOVA)?
|
| Greetings.
|
| Felipe
|
| __
| 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


-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMuxT0ACgkQWtdQtNzjBl7LWACcCddjPgTnZX2+15aDLbxe+qxD
rHcAoIdkgW8ke/M8bb7pSlcptTz9K53j
=eCEC
-END PGP SIGNATURE-

__
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] Problems compiling Hmisc

2005-09-16 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi.
I am trying to install Hmisc from source on MacOS 10.4.2, using the R
for Mac OS X Aqua GUI 1.12. I have installed g77(using Fink). I am using
the Package installer provided by the GUI, and this is the output I obtain:

* Installing *source* package 'Hmisc' ...
** libs
g77   -fno-common  -g -O2 -c cidxcn.f -o cidxcn.o
g77   -fno-common  -g -O2 -c cidxcp.f -o cidxcp.o
g77   -fno-common  -g -O2 -c hoeffd.f -o hoeffd.o
g77   -fno-common  -g -O2 -c jacklins.f -o jacklins.o
g77   -fno-common  -g -O2 -c largrec.f -o largrec.o
gcc-3.3 -no-cpp-precomp
- -I/Library/Frameworks/R.framework/Resources/include
- -I/usr/local/include   -fno-common  -g -O2 -c ranksort.c -o ranksort.o
g77   -fno-common  -g -O2 -c rcorr.f -o rcorr.o
g77   -fno-common  -g -O2 -c wclosest.f -o wclosest.o
gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o
Hmisc.so cidxcn.o cidxcp.o hoeffd.o jacklins.o largrec.o ranksort.o
rcorr.o wclosest.o  -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2
- -lg2c -lSystem -framework R

The downloaded packages are in
/private/tmp/Rtmpl1pDLj/downloaded_packages
ld: can't locate file for: -lg2c
make: *** [Hmisc.so] Error 1
ERROR: compilation failed for package 'Hmisc'

It seems to be a problem with the linker, but no idea. Do I need to
install any library or another Fink package?

Thank you.

Felipe

- --oOo--
Felipe Martínez-Pastor (BSc, PhD)
Animal Reproduction and Obstetrics
Veterinary Clinic Hospital
24071-León (Spain)
Phone: 987 291 430 / 987 291 000 + 5203
Fax: 987 295 203
e-mail: [EMAIL PROTECTED]

- ---
This message has been electronically signed using GPG, a free system to
sign and encrypt documents. If you want to learn more, visit
http://www.gnupg.org
-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMqkN0ACgkQWtdQtNzjBl5kFACfSBopAnm/S2PTEbSyZGhOt4q0
zeQAn3MajbnFXWWhVd7gT+fQ5fGE85Ro
=lssZ
-END PGP SIGNATURE-

__
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] Are least-squares means useful or appropriate?

2005-09-16 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi.
I have been reading about the convenience of using least-squares means
(a. k. a. adjusted means) in multiple comparisons (I used to resort to
them when using SAS). I even read a post in this list warning against
them, but not giving much detail. What do you think about this?
Greetings.

Felipe
-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMqq5gACgkQWtdQtNzjBl4AigCfQJ64O0wrdYK/1iMReW5RtI1d
tMIAn3DQSdk+4D7AK7VQGtWo0TElrFG7
=j9EX
-END PGP SIGNATURE-

__
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] means comparison in R (post-hoc test)

2005-09-15 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi.

I have been using SAS for some time, and now I have discovered R. I am
very happy with it, but I have not found out how to perform some of the
multiple comparisons I was used to do in SAS.

With the SAS/STAT, I generally used the MEANS (for comparison of
arithmetic means) and the LSMEANS (for adjusted means) statements of the
GLM procedure (I think it is equivalent to lm in R). They provided a lot
of tests: LSD, Duncan, Tukey-Kramer, Bonferroni, Scheffé, SNK, etc.
However, in R I have only discovered Tukey-HSD.

I have searched for information about this, but I was not successful. I
wonder if anybody knows where I could learn about this. I would like to
use these tests in R, and also obtain the adjusted means like these
produced by the LSMEANS statement.

Thank you.

Felipe
- --oOo--
Felipe Martínez-Pastor (BSc, PhD)
Animal Reproduction and Obstetrics
Veterinary Clinic Hospital
24071-León (Spain)
Phone: 987 291 430 / 987 291 000 + 5203
Fax: 987 295 203
e-mail: [EMAIL PROTECTED]

- ---
This message has been electronically signed using GPG, a free system to
sign and encrypt documents. If you want to learn more, visit
http://www.gnupg.org
-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMpUVYACgkQWtdQtNzjBl4rywCePiSxJw8/N6HzdZ7C+YMHf2K6
YSYAniw5GSo0ihrt4+OabHJ4c2PKNHkp
=aF38
-END PGP SIGNATURE-

__
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] means comparison in R (post-hoc test)

2005-09-15 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thank you, I think multcomp is very near to what I was looking for.
However, I am still looking for a mean to obtain least-squares
(adjusted) means and std. errors of these means, and performing
comparisons among these means, as the LSMEANS do in SAS. I have read
other messages and have looked at car, effects and Design manuals, but I
am not sure if this is what I am looking for. Any clue?

Felipe

Dieter Menne wrote:
| Felipe felipe at unileon.es writes:
|
|
|With the SAS/STAT, I generally used the MEANS (for comparison of
|arithmetic means) and the LSMEANS (for adjusted means) statements of the
|GLM procedure (I think it is equivalent to lm in R). They provided a lot
|of tests: LSD, Duncan, Tukey-Kramer, Bonferroni, Scheffé, SNK, etc.
|However, in R I have only discovered Tukey-HSD.
|
|
| Package multcomp with the workhorse-function simint comes close to
what you
| want.
|
|
| Dieter
|
| __
-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMpo6UACgkQWtdQtNzjBl72rwCcCuw5qxD1BWsensDI71RzhNgL
MUcAnA0Iq4tfoKSr/ymIV1nEZHZijvLW
=pavA
-END PGP SIGNATURE-

__
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] Copying from graphics window in OS X

2005-09-15 Thread Felipe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm using R for Mac OS X Aqua GUI. It allows me to copy graphs directly,
simply with command-c.
It's pretty nice, you can give it a try.
Greetings.
Felipe

Chris Wiita wrote:
| I'm running R from an Xterm window is OSX-Tiger.  Graphical windows
| appear as they should, but I'm having trouble copying from them--using
| cmd+c or the Copy option in the Edit menu won't place the graph in the
| clipboard (when I paste into a running OS X app, I get whatever was the
| last copied thing from a non-x11 window).  Any ideas on how to copy from
| a xterm-launched graphical window?  I can copy/paste into and out of the
| xterm command line, but I can't get anything from a graphical window.
|
| Thanks!
|
| __
| 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
|
|
-BEGIN PGP SIGNATURE-

iEYEARECAAYFAkMp1eYACgkQWtdQtNzjBl59JgCfV7JR8kbsbYvMQG6OVt/plNTd
1S8AnRTHe6cRrwr0mxbJJGXmdkRibDvV
=Pc3t
-END PGP SIGNATURE-

__
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] Problems plotting time-series with multiple lines

2005-09-03 Thread Felipe Csaszar
He you checked this example?:
z - ts(matrix(rt(200 * 8, df = 3), 200, 8), start = c(1961,1), frequency = 
12)
z - window(z[, 1:3], end = c(1969, 12))
plot(z, plot.type = single, lty = 1:3, col = 4:2)

It is from the help page of plot.ts

Felipe


Jose Augusto Jr - jamaj - terra [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Dear Sirs,

I want to plot a time series with lines, one for each variable.
I have a dataset with dates, and the values.
How can i plot?
I could plot one variable using index plot, bu i want to put the labels on X
axis. But i had two problems:
1) The plot function, when i try to plot(x,y), incorectly sort the date (on
X axis). My dataset has the date in string format %d/%m/%Y).
If i try to converto to date using
as.Date(Dataset.dates,%d/%m/%Y)
it interprets the %Y incorrectly.

2) I have 187 rows. So i have to plot only some of the dates, not all.

Please, help me.

Thanks in advance.

Best Regards,

José Augusto M. de Andrade Jr.

Computer games don't affect kids; I mean if Pac-Man affected us as kids,
we'd all be running around darkened rooms, munching magic pills and
listening to
repetitive electronic music. (Kristian Wilson, Nintendo, Inc. 1989)

__
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


Re: [R] 3d cube with labels along axes

2005-09-02 Thread Felipe Csaszar
This may work:
- use option axes=F in persp
- use locator() to get the coordinates where you want to put your new labels
- use text(x,y,...) to write your new labels

It is a little bit tedious, but it should work. Regards,

Felipe



jonne [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi R-users,

 I would like to draw a cube with a grid on it and labels along all
 three axes. I have trouble printing the labels correctly. My
 best attempt is described below.
   Can somebody explain me how I can change the 0,20,40,80,100
 along the x axis into character vectors like
 no, light, intermediate, severe ?

 x - seq(0, 100, length=10)
 #x - c(no, light, intermediate, severe)
 y - x
 f - function(x,y) { numeric(length=100) + 5 }
 z - outer(x, y, f)

 P - persp(x, y, z, theta=30, phi=30, zlim=c(-10,10), ticktype=detailed)

 text3d(0, 0, -10, Hello world, P)

 Thanks in advance,
 Jonne.

 __
 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] complex expression with plotmath

2005-08-14 Thread Felipe Csaszar
Hello everyone,

I want to define a function that receives the name of two variables
(may include Greek letters and subscripts) and uses them into the
title of a plot.

My best attempt is the following:
myplot - function(var1, var2) {
v=paste(var1,==1  ,var2,==2);
plot(1:10, main=parse(,,v))
}

But when I call it with something like myplot(Q[i], Delta[j]) I
get (Q_i=1,Delta_j=2) as title when I want to get Q_i=1 
Delta_j=2.

Is there any solution within R? (I don't want to use psfrag and Latex
to post-process the plot)

Why R does not have support for full Latex expressions? (as Matlab
f.ex.). IMHO plotmath is not good enough.

Thank you all.

Felipe

__
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] complex expression with plotmath

2005-08-14 Thread Felipe Csaszar
Thanks, it worked!

So the cute trick was the call to *quote* inside the function call.

Thanks again,

Felipe



On 8/14/05, Gabor Grothendieck [EMAIL PROTECTED] wrote:
 On 8/14/05, Felipe Csaszar [EMAIL PROTECTED] wrote:
  Hello everyone,
 
  I want to define a function that receives the name of two variables
  (may include Greek letters and subscripts) and uses them into the
  title of a plot.
 
  My best attempt is the following:
  myplot - function(var1, var2) {
 v=paste(var1,==1  ,var2,==2);
 plot(1:10, main=parse(,,v))
  }
 
  But when I call it with something like myplot(Q[i], Delta[j]) I
  get (Q_i=1,Delta_j=2) as title when I want to get Q_i=1 
  Delta_j=2.
 
  Is there any solution within R? (I don't want to use psfrag and Latex
  to post-process the plot)
 
  Why R does not have support for full Latex expressions? (as Matlab
  f.ex.). IMHO plotmath is not good enough.
 
 
 Try this:
 
 
 myplot - function(var1, var2)
 plot(1:10, main = bquote(.(var1) == 1 ~  ~ .(var2) == 2))
 myplot(quote(Q[i]), quote(Delta[j]))


__
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] type III Sum Sq in ANOVA table - Howto?

2003-03-07 Thread Felipe
Hi! I have found your comments very interesting, but I feel I am one of 
these people that do not understand what the hell they are really 
testing :D
Could you (or anybody) suggest me a good web site to gather this kind 
of information? Sometimes I cannot fully understand the messages of the 
list because I lack some knowledge background.
Thank you.

Felipe

El Viernes, 7 marzo, 2003, a las 01:31 AM, Rolf Turner escribió:

Andy Liaw wrote:

 The long(er) answer: think harder about what question(s) you want 
answered
 (i.e., what hypotheses you really want to test, and test only 
those).  The
 model hierarchy says that a model should not have an interaction term
 involving a factor whose main effect is not present in the model.  
Seen in
 this light, the hypothesis you're trying to test involves a 
non-sensical
 model.
Not really.  The hypothesis being tested by Type III sums of square
may be suspected of not being of ``central interest'', but it is NOT
(as is commonly believed) ``non-sensical''.
Let us think about the 2-way ANOVA case, where one can actually
understand what is going on.  Let the population ***cell means*** be
mu_ij (i = 1, ..., m, j = 1, ..., n) and forget about the confusing
and misleading over-parameterized model.
Testing for the significance of the ``row factor'' by Type III
sums of squares (with interaction in the model of course) tests
	H_0: mu_{1.}-bar = mu_{2.}-bar = ... = mu_{m.}-bar

I.e. that the means of the population cell means, over columns, are
all equal.  I.e. that ``when rows are averaged over columns'' there
is no row effect.
This could, at least conceiveably, be of interest.  Note that the
average is not a weighted average, saying that all columns are
equally important.  If all columns are NOT equally important (e.g.
if an item randomly drawn from the population is more likely to
``come from'' column 1 than from column 2 etc.) then this hypothesis
is less likely to be of interest.
But it isn't nonsensical.

It is true, however, that most of the time when people test things
using Type III sums of squares they don't understand what they are
really testing.  But then (said he cynically) people don't understand
what the hell they are really testing in most situations, not just
in the context of Type III sums of squares.
cheers,

	Rolf Turner

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] SAS/SPSS - R migration

2003-01-18 Thread Felipe
Hi! I am starting to use the R system. Till now I have been using SAS 
and SPSS, as my university and department has licences of them.
I would like to know if there is a mail list in Spanish (this is my 
native language), and if there is some kind of tutorial specially 
oriented to people used to work with SAS or SPSS who want to migrate to 
R.
Thank you!

Felipe

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help