similar to: Function to standardize matriz?

Displaying 20 results from an estimated 3000 matches similar to: "Function to standardize matriz?"

2009 Aug 13
4
lm coefficients output confusing
Hi all, I have an issue with the lm() function regarding the listing of the coefficients. My data are below, showing a list of hours (HR) relating to the time spent resting (R) by an individual animal. Simply i want to run a lm() to run in an anova() to see if there is a significant difference in resting between hours. HR R 1 2 0.6666667 2 2 0.4666667 3 2 0.8000000 4 2
2010 Aug 31
4
weird to me interaction between time() and %%, %/%
Dear List, I'm getting weird and unexpected behaviour using time and %%, or %/%. It's likely I'm not appreciating the nuances of floating point arithmetic. Or it could be a bug. I'm running > R.version _ platform x86_64-redhat-linux-gnu kernel 2.6.33.8-149.fc13.x86_64 arch x86_64 os linux-gnu system x86_64, linux-gnu
2009 Nov 03
1
creating mulptiple new variables from one data.frame according to columns and rows in that frame
Dear R-helpers, I have a data.frame (bcpe.lat.m) containing 13 countries, ages 0-50yrs per month, and the corresponding mu&sigma (see below). * I would like to limit the age range to include all 12 months for the 1st 5 years and only whole years for all ages thereafter for each of the countries present in the data frame. * I would like to create separate data.frames according
2010 Jan 30
2
aggregate by factor
I have a data frame with two columns, a factor and a numeric. I want to create data frame with the factor, its frequency and the median of the numeric column > head(motifList) events score 1 aeijm -0.25000000 2 begjm -0.25000000 3 afgjm -0.25000000 4 afhjm -0.25000000 5 aeijm -0.25000000 6 aehjm 0.08333333 To get the frequency table of events: > motifTable <-
2011 Dec 08
1
prop.test() and the simultaneous confidence interval for multiple proportions in R
Dear list members, I want to perform in R the analysis "simultaneous confidence interval for multiple proportions", as illustrated in the article of Agresti et al. (2008) "Simultaneous confidence intervals for comparing binomial parameter", Biometrics 64, 1270-1275. If I am not wrong the R function implementing the Agresti et al. method is prop.test(). I ask an help because I
2011 Sep 29
1
julian day form POSIXt object
hello all, this is my reproducible example data frame test<-structure(list(date = structure(c(1262300400, 1262304000, 1262304000, 1262307600, 1262307600, 1262311200, 1262311200, 1262314800, 1262314800, 1262318400, 1262318400, 1262322000, 1262322000, 1262325600, 1262325600, 1262329200, 1262329200, 1262332800, 1262332800, 1262336400, 1262336400, 1262340000, 1262340000, 1262343600,
2011 Jan 26
2
2 functions with same name - what to do to get the one I want
There seems to be 2 functions call ecdf... http://lib.stat.cmu.edu/S/Harrell/help/Hmisc/html/ecdf.html http://127.0.0.1:11885/library/stats/html/ecdf.html How do I get the one ecdf {Hmisc} to run instead of the ecdf {stats} A pointer in the right direction would be greatly appreciated. Tried to instal Hmisc but got this message, so I assume I have it > utils:::menuInstallPkgs() Warning:
2008 Oct 15
2
Condition warning: has length > 1 and only the first element will be used
Hello, I've been learning R functions recently and I've come across a problem that perhaps someone could help me with. # I have a a chron() object of times > hours=chron(time=c("01:00:00","18:00:00","13:00:00","10:00:00")) # I would like to subtract 12 hours from each time element, so I created a vector of 12 hours (actually, more like a
2010 Feb 26
7
question to make a vector without loop
Hello all, I want to define a vector like w[k+1]=w[k]*a/(b+k) for k=1,...,N-1 without use loop. Is it posible to do in R? Regards khazaei
2009 Feb 27
1
cross tabulation: convert frequencies to percentages
Hello, might be rather easy for R pros, but I've been searching to the dead end to ... twsource.area <- table(twsource, area, useNA="ifany") gives me a nice cross tabulation of frequencies of two factors, but now I want to convert to pecentages of those absolute values. In addition I'd like an extra column and an extra row with absolute sums. I know, Excel or the
2007 May 05
1
(no subject)
Dear Mailing-List, I think this is a newbie question. However, i would like to integrate a loop in the function below. So that the script calculates for each variable within the dataframe df1 the connecting data in df2. Actually it takes only the first row. I hope that's clear. My goal is to apply the function for each data in df1. Many thanks in advance. An example is as follows: df1
2018 Jun 22
3
loop con matriz que cambia de nombre
Buenos días. Quiero hacer un for (j), anidado en otro for (i). En el 2º for, en cada iteración ha de crear una matriz vacía: mat <- matrix(nrow=nrow(data),ncol=19) pero llamándola de forma distinta cada vez. El nombre ha de ser: paste("D",i,colnames(Data[j]),sep=""). Llevo un rato haciendo pruebas pero no me sale. A ver si alguien pudiera ayudarme, gracias, Manuel
2017 Apr 17
2
Matriz como producto de vectores.
Buenas tengo una matriz de contingencia de 5x4 donde en la última fila y última columna tengo las frecuencias marginales, en función de estas quiero sacar las esperadas, pero cuando hago por ejemplo el producto,, Esperadas<-Estrategia["Suma",]*Estrategia[,"Suma_e"] E1 E2 E3 E4 Suma 5550 14160 52650 89600 20720 Warning message: In Estrategia["Suma", ]
2018 Jun 22
4
loop con matriz que cambia de nombre
Funciona, me crea una matriz en cada iteración, con un nombre que incluye el nº de la iteración. Me surge ahora el problema de que, dentro del mismo bucle la quiero convertir en df y ponerle nombre a las columnas, y como el nombre de la matriz es distinto cada vez, no sé cómo hacerlo. Supongo que se hará todo al crearla, pero no sé cómo. Un problema adicional es que las variables
2012 Dec 06
1
Can somebody help me with following data manipulation?
Dear all, let say I have following data: dat <- structure(list(V1 = structure(c(1L, 4L, 5L, 3L, 3L, 5L, 6L, 6L, 4L, 3L, 5L, 6L, 5L, 5L, 4L, 4L, 6L, 2L, 3L, 4L, 3L, 3L, 2L, 5L, 3L, 6L, 3L, 3L, 6L, 3L, 6L, 1L, 6L, 5L, 2L, 2L), .Label = c("C", "G", "I", "O", "R", "T"), class = "factor"), V2 = c(0L, 0L, 0L, 1L, 1L, 1L, 1L, 0L,
2018 Jun 23
2
loop con matriz que cambia de nombre
Bien, Carlos, lo de ir metiendo las dfs en una lista parece buena idea, y después puedo fusionarlas con un cbind, tal y como hago ahora mismo, después de crear cada una de ellas independientemente. Son 9 dfs, y obtener cada una de ellas toma bastante tiempo de computación. Lo que quiero es que me haga las 9 en un loop. El problema es que si no les pone nombres distintos a las variables,
2018 Jun 25
2
loop con matriz que cambia de nombre
Gracias Carlos, eso lo sé. El problema, probablemente una chorrada, es que para cambiarle el nombre a las variables (de acuerdo a un patrón, si, que incluye el nº de la iteración), debo indicar el nombre de la df, pero éste no es siempre el mismo. Puedo darle un nombre fijo a la df, ponerle el nombre a las variables, y al final del loop cambiarle el nombre a la df, pero tampoco sé cómo
2002 Feb 13
3
xtabs
Hi, In Splus if I call the function crosstabs() the output is a contigency table; in each cell of the table is printed: N, N/RowTotal, N/ColTotal, N/Total. N is the number of observations in each cell. The same call to xtabs() in R will produce the contigency table but the only entry in each cell is N. How can I get the same relative frequencies that crosstabs() gives? Thanks, mike --
2018 Jun 24
2
loop con matriz que cambia de nombre
Gracias Javier, pero creo que si no consigo que me lo haga todo de una vez con un loop, me merece más la pena hacerlo como hasta ahora, una a una. Manuel Quoting Javier Marcuzzi <javier.ruben.marcuzzi en gmail.com>: > Estimado Manuel Mendoza > > No sería lo ideal, pero de pronto podría ir guardando en json, que es una > forma no estructurada, luego toma los datos
2010 Apr 18
3
xtabs() of proportions, and naming a dimension (not a row)
Hi, xtabs() creates a table of counts. I want a table of proportions -- that is, I want to divide every vector (along a particular dimension) by its sum. The tiny example below does that. The call to xtabs() creates a matrix "A" with dimensions ("x1","x2","y"). I transform "A" using aperm() and aaply() to get the matrix "B". The