[R-es] Friedman

José Trujillo Carmona truj|||o @end|ng |rom unex@e@
Mie Dic 11 14:33:55 CET 2019


Una vez corregido el error de la última fila, el procedimiento funciona:

 > y <- read.table("clipboard", header = TRUE)

 > friedman.test(as.matrix(y))

     Friedman rank sum test

data:  as.matrix(y)
Friedman chi-squared = 23.333, df = 5, p-value = 0.0002915

Hay que tener en cuenta que el test de friedman admite dos forma de 
entrada de los datos, bien mediante la definición de grupos y bloques o 
bien mediante una matriz en la que las columnas son los niveles del 
factor (grupos) y las filas son los bloques:

## Default S3 method:
friedman.test(y, groups, blocks, ...)
... ...
groups: a vector giving the group for the corresponding elements of y if this is a vector; ignored if y is a matrix.

read.table crea un dataframe, no una matriz.

Saludos

El 11/12/19 a las 14:10, Jose Betancourt B. escribió:
> Estimados
>
> Este es el test de friedman que se logra asi
>
> library(PMCMR)
> y <- matrix(c( 3.88, 5.64, 5.76, 4.25, 5.91, 4.33, 30.58, 30.14, 16.92,
>    23.19, 26.74, 10.91, 25.24, 33.52, 25.45, 18.85, 20.45,
>    26.67, 4.44, 7.94, 4.04, 4.4, 4.23, 4.36, 29.41, 30.72,
>    32.92, 28.23, 23.35, 12, 38.87, 33.12, 39.15, 28.06, 38.23,
>    26.65),nrow=6, ncol=6,
>    dimnames=list(1:6,LETTERS[1:6]))
> print(y)
> friedman.test(y)
> durbin.test(y)
>
> RESULTADO
> Friedman rank sum test
> data:  y
> Friedman chi-squared = 23.333, df = 5, p-value = 0.0002915
>
>> durbin.test(y)
> 	Durbin rank sum test
> data:  y
> Durbin chi-squared = 23.333, df = 5, p-value = 0.0002915
>
> ===============================
> Me pregunto porque no obtengo ese resultado al copiar en clipboard
> estos datos o al leerlos desde excel
>
>
>
>   A     B     C    D     E     F
> 3.88 30.58 25.24 4.44 29.41 38.87
>   5.64 30.14 33.52 7.94 30.72 33.12
>   5.76 16.92 25.45 4.04 32.92 39.15
>   4.25 23.19 18.85 4.40 28.23 28.06
>   5.91 26.74 20.45 4.23 23.35 38.23
> 6 4.33 10.91 26.67 4.36 12.00 26.65
>
> y <- read.table("clipboard", header = TRUE)
> y
>
> Me da esta información
> friedman.test(y)
> Error in friedman.test.default(y) :
>    argument "groups" is missing, with no default
>
> EN RESUMEN QUISIERA LEER ESTOS DATOS DESDE EXCEL, CSV , TXT O
> CLIPBOARD Y QUE ME HAGA EL ANÁLISIS
>
> Saludos
> José
>
> _______________________________________________
> R-help-es mailing list
> R-help-es using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es

	[[alternative HTML version deleted]]



Más información sobre la lista de distribución R-help-es