search for: mysds

Displaying 11 results from an estimated 11 matches for "mysds".

Did you mean: msds
2015 Sep 14
3
Optimization bug when byte compiling with gcc 5.2.0 on windows
When building R-devel with gcc 5.2.0 (mingw-w64 v4) on Windows, make check fails reg-tests-1b.R at the following check: x <- c(1:2, NA) sx <- sd(x) !is.nan(sx) Here 'sx' should be 'NA' but it is 'NaN'. It turns out this problem only appears when the function is byte compiled with optimization level 3: mysd <- function (x, na.rm = FALSE) sqrt(var(if
2007 Feb 23
1
how to use apply with two variables
Hi, this is a made-up example. Function "myfun" returns two arguments. Can "apply" be used so that "myfun" is called only once? Thanks Serguei mat<-matrix(runif(50),nrow=10,ncol=5) myfun<-function(x) { mymean<-mean(x) mysd<-sd(x) return(mymean,mysd) } out1<-t(apply(mat,1,function(x) myfun(x)$mymean)) out2<-t(apply(mat,1,function(x)
2010 Jun 29
1
Sweave, xtable plus/minus sign
Dear R-users, please consider the following minimal example: \documentclass[a4paper,titlepage,onecolumn,12pt]{article} \usepackage[italian]{babel} \usepackage{amssymb} \usepackage[utf8x]{inputenc} \usepackage[pdftex]{graphicx} \begin{document} <<label=test, echo=FALSE, results=tex>>= df.data1 <- cbind.data.frame(A = rnorm(18), B =factor(rep(LETTERS[1:6],
2015 Sep 14
0
Optimization bug when byte compiling with gcc 5.2.0 on windows
I believe the issue is that on Windows the sqrt function when called with a NaN does not return the same NaN, as it does on other platforms. We have #if (defined(_WIN32) || defined(_WIN64)) && defined(__GNUC__) && \ __GNUC__ <= 4 # define R_sqrt(x) (ISNAN(x) ? x : sqrt(x)) #else # define R_sqrt sqrt #endif for implementing the SQRT opcode. I suspect this came from Duncan
2010 Jun 23
2
About normality tests...
Hi all, I have two very large samples of data (10000+ data points) and would like to perform normality tests on it. I know that p < .05 means that a data set is considered as not normal with any of the two tests. I am also aware that large samples tend to lead more likely to normal results (Andy Field, 2005). I have a few questions to ensure that I am using them right. 1) The Shapiro-Wilk
2015 Sep 14
2
Optimization bug when byte compiling with gcc 5.2.0 on windows
On 14/09/2015 9:36 AM, luke-tierney at uiowa.edu wrote: > I believe the issue is that on Windows the sqrt function when called > with a NaN does not return the same NaN, as it does on other platforms. > We have > > #if (defined(_WIN32) || defined(_WIN64)) && defined(__GNUC__) && \ > __GNUC__ <= 4 > # define R_sqrt(x) (ISNAN(x) ? x : sqrt(x)) > #else
2007 Jul 07
1
calculating p-values of columns in a dataframe
I have a dataframe ("mydf") that contains "differences of means". I wish to test whether these differences are significantly different from zero. Below, I calculate the t-statistic for each column. What is a "good" method to calculate/look-up the p-value for each column? mydf=data.frame(a=c(1,-22,3,-4),b=c(5,-6,-7,9)) mymean=mean(mydf) mysd=sd(mydf)
2008 Sep 25
0
sd() of column, but for a subset of rows
I would like to take the standard deviation of a column, but only for a subset of the rows in that column with a given index. The following loop worked fine when I wanted the mean, but is not working for the standard deviation: for (i in 1:length(x[1,])){ a<-tapply(x[,i],x[,2],sd, na.rm=TRUE) xnew<-cbind(xnew,a)} I have tried re-defining the sd as follows (as suggested on this board),
2008 Jul 08
2
Change in behaviour of sd()
Hi I have just upgraded from R2.6.0 to R2.7.1 (running on Windows) and a part of my code that previously ran ok now gives an error. The following is a simple example to demonstrate my problem. > a <- array(c(1,2,3,4,5,6,rep(NA,6)),dim=c(6,2)) > apply(a,2,sd,na.rm=T) In R2.6.0 this gives (which is what I would like) [1] 1.870829 NA In R2.7.1 it gives the following error
2008 Oct 17
2
function help
Hi everyone, I have dataset which I make a sample of it couple of times and each time I get the mean and standard deviation of each row for each sample. I have a function for that, which takes the name of the file and number of times to sample and then returns the mean and standard deviation for each row in each sample. Sample=function(name, n){
2008 Jun 19
1
PrettyR (describe)
#is there a way to get NA in the table of descriptive statistics instead of the function stopping Thank you in advance #data x.f <- structure(list(Site = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L), .Label = c("BC", "HC", "RM119", "RM148", "RM179", "RM185",