[R] type II and III Sum square whit empty cells

2006-04-11 Thread Mario Morales
Dear all

I need to run an anova from a factorial model

y_{ijk}=\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk}

and calculate type II and III sums of square, but I have an empty
cells, so anova function from package car fail. (I believe)


y-c(7,13,6,10,8,11,8,3,7,5,65)

a-as.factor(c(1,1,2,2,3,3,3,1,1,1,2))

b-as.factor( c(rep(1,7),rep(2,4)) )

table(b,a) # cell (2,3) is empty

mod-lm(y~ a+b+a:b)

library(car)

Anova(mod,type=II)  # don't work

How can I calculate type II and III sum of square whit empty cell?

Thanks a lot

__
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] Drawing a circle

2005-05-19 Thread Mario Morales
Hi.
I need to draw a circle whit center (a,b) and radio r. So I use the
R code below
a-1.975 # valore x del centro
b-1.215 # valores y del centro
r-1.46 # radio
x1-seq(a-r,a+r,by=0.01); #los valores de x
yp-sqrt(r^2-(x1-a)^2)+b; # los valores y a partir de la raíz positiva
yn-(-1)*sqrt(r^2-(x1-a)^2)+b; # los valores y a partir de la raíz negativa
x-c(x1,x1);  y-c(yp,yn);
plot(x,y,type=l,ylab=,xlab=,xlim=range(x),ylim=range(y));
My circle have two problems.
First. I don't want the horizontal line and I don't know how avoid
it.
Second. It is shaped like ellipse. I need adjust the x and y scales,
but I don't know how.
Can you help me???
there is another way to draw a circle whit R ?
__
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] writing a data frame in excel format

2005-04-25 Thread Mario Morales
Hello
I know how read a file in excel format into a R data frame using the
RODBC library, but I don't know how write a R data frame in excel
format. I don't understand the instructions from RODBC user manual.
To read an excel file I use.
library(RODBC);
conex-odbcConnectExcel(fis_quim.xls);
sqlTables(conex);
data-sqlFetch(conex,hoja1);
Suppose I modify data and I want to save it as an excel file, How do
I do that?
Thanks for your help
Mario Alfonso Morales Rivera
Profesor Auxiliar.
Departamento de Matemáticas y Estadistica.
Universidad de Córdoba.
__
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] a R function for sort a data frame.

2005-04-01 Thread Mario Morales
Is there a R function for sort a data frame by a variable ?
I know sort a vector, but I don't know sort a data frame by a
column. Can you help me ?
the sort() function don't  work with data frame.
__
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] How I calculate nCr with R ? (Como calculo nCr con R? )

2005-03-19 Thread Mario Morales
En español  (In Spanish)
Necesito calcular la en numeros de combinaciones de n cosas
tomando k al tiempo.
Como hago eso en R ???
Yo escribí mi propia función pero pienso que  de esa forma no es
fácil para mis estudiantes .
He estado buscando en la ayuda y no he encontrado información
sobre una función que calcule eso directamente. Podrían ayudarme
In English (en Inglés )
I need calculate the combination of n things taking k at time.
How do I do that in R ?
I wrote my own function but in this form isn't easy for my
students.
Can you help me ?
__
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