search for: signif

Displaying 20 results from an estimated 1264 matches for "signif".

2005 Jan 19
2
signif() generic
...values and their (estimated) errors, > setClass("sec", representation(val="numeric", err="numeric")) I've already successfully implemented basic arithmetics using mostly the "Arith" group generics. But I'm running into trouble when trying to get signif() to work for my purposes, i.e. with a default argument (digits=2): When trying > seMethod("signif", signature(x="sec", digits="numeric")), function(x, digits=2){ # ...do something... } ) and > signif(sec1) I get > Error in signif(x, digits) : Non-n...
2005 Apr 21
1
printCoefmat(signif.legend =FALSE) (PR#7802)
printCoefmat(signif.legend =FALSE) does not work properly. The option "signif.legend = FALSE" is ignored as shown in the example below. cmat <- cbind(rnorm(3, 10), sqrt(rchisq(3, 12))) cmat <- cbind(cmat, cmat[,1]/cmat[,2]) cmat <- cbind(cmat, 2*pnorm(-cmat[,3])) colnames(cmat) <- c("Estim...
2003 Mar 14
1
Formatting significant digits with trailing zeros
I need a function like signif(), but returns the rounded values as character strings, formatted with trailing zeros where appropriate. If anyone has one, I would sure appreciate a copy. Thanks -Don Details: signif() rounds a number to a specified number of significant digits, for example: > x <- c(2.503,2.477,0....
2003 Feb 06
1
signif {base}: changes to scientific notation
PROBLEM `signif' does change to scientic notation at different levels depending on the number of significant digits in the input. This can generate tables where figures change ``irregularly'' from normal to scientific notation. PROPOSAL The change to the scientific notation shoul...
2011 Dec 08
2
Behavior of apply()
Suppose I have the following matrix > class(cov_50) [1] "matrix" > cov_50 [,1] [,2] [1,] 0.3201992 2.308084 [2,] 6.7312928 5.719641 I then use the following function via apply and get the desired output, a list signif <- function(x) which(abs(x) > 1.96) apply(cov_50, 1, signif) > apply(cov_50, 1, signif) [[1]] [1] 2 [[2]] [1] 1 2 However, I can't see why the following occurs > class(cov_25) [1] "matrix" > cov_25 [,1] [,2] [1,] 12.116106 14.81248 [2,] 5.492176 4.73...
2011 Oct 17
1
compressing/reducing data for plot
...slow! (Takes about 4 seconds for each 1e5 element dataframe) * It does not work well if the values increase/decrease monotonically with small values - it will remove them all since the difference between each point and its predecessor is minimal I included my own function below: === cut === get_significant_rows_1 <- function (data, threshold) { # get the difference between each datapoint and the following datapoint # of course this list is one shorter than the input dataset, which does # not matter since the first and last datapoint will always be included diffs = abs(data[1:nrow(data)-1,] -...
2006 Nov 09
2
Single precision data behaviour with readBin()
..., which is what I've tried: > zz <- file(file, "rb") > h1 <- readBin(con = zz, what = double(), n = 1, size = 4) > h1 [1] 0.0500000007451 Except that I know that the first value should be exactly 0.05. To get rid of the unwanted (or really unknown) values, I try using signif(), which gives me: > h1 <- signif(h1, digits = 8) > h1 [1] 0.050000001 I suppose I could use: > h1 <- signif(h1, digits = 7) > h1 [1] 0.05 But this does not seem ideal to me. Apparently I don't understand machine precision very well, because I don't understand where th...
2005 Jun 06
6
Strange characters in 2.1.0?
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Signif. codes: 0 <80><98>***<80><99> 0.001 <80><98>**<80><99> 0.01 <80><98>*<80> <99> 0.05 <80><98>.<80><99> 0.1 <80><98> <80>&lt...
2019 Mar 27
1
default for 'signif.stars'
...e of The American Statistician just came out, and its theme is the [mis]use of P values and the many common ways in which they are abused. The lead editorial in that issue mentions the 2014 ASA guidelines on P values, and goes one step further, by now recommending that the words "statistically significant" and related simplistic interpretations no longer be used. There is much discussion of the problems with drawing "bright lines" concerning P values. This is the position of a US society, but my sense is that the statistical community worldwide is pretty much on the same page....
2010 Oct 20
1
rounding up (always)
Hello! I am trying to round the number always up - i.e., whatever the positive number is, I would like it to round it to the closest 10 that is higher than this number, the closest 100 that is higher than this number, etc. For example: x<-3241.388 signif(x,1) rounds to the closest thousand, i.e., to 3,000, but I'd like to get 4,000 instead. signif(x,2) rounds to the closest hundred, i.e., to 3,200, but I'd like to get 3,300 instead. signif(x,3) rounds to the closest ten, i.e., to 3,240, but I'd like to get 3,250 instead. Of course, I c...
1997 May 27
1
R-alpha: signif( small , d) gives NA
signif(.) is a <primitive> function. Unfortunately, I couldn't even find WHERE in the source, signif(.) is defined. Here are the symptoms: xmin <- .Machine $ double.xmin signif(xmin,3) #--> NA umach <- unlist(.Machine)[paste("double.x", c("min","max")...
2005 May 22
3
comparison operator, decimals, and signif()
...that the following would return TRUE: > testMean <- 82.8 + 0.1 > testMean [1] 82.9 > testMean == 82.9 [1] FALSE Apparently this has to do with deciml places. Look: > newTest <- 82.0 > newTest [1] 82 > newTest == 82 [1] TRUE > newTest == 82.0 [1] TRUE > What does signif() do to my object called "testMean" so that the comparison now evaluates to TRUE? > signif(testMean, 3) == 82.9 [1] TRUE Version info: > R.Version() $platform [1] "i386-pc-mingw32" $arch [1] "i386" $os [1] "mingw32" $system [1] "i386, mingw3...
2009 Dec 21
3
Signif. codes
My question is about the "Signif. codes" and the p-value, specifically, the output when I run summary(nameofregression.lm) So you get this little key: Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 And on a regression I ran, next to the intercept data, I get '***' Coefficients: > >...
2008 Jun 02
6
significant digits (PR#9682)
...ncan Murdoch wrote: >>On 13/05/2007 8:46 PM, scott.wilkinson at csiro.au wrote: >> >> In the example below round() does not report to the specified number of >> digits when the last digit to be reported is zero: Compare behaviour for >> 0.897575 and 0.946251. Ditto for signif(). The number of sigfigs is >> ambiguous unless the reader knows this behaviour. Is this a bug or >> intended behaviour? Is there a work-around? > > It's not a bug. It has nothing to do with round(), it is the way R > prints numbers by default. If you ask to print 0.90, y...
2013 Oct 02
0
For numeric x, as.character(x) doesn't always match signif(x, 15)
I saw something like this. > x <- 5180000000000003 > print(x, digits=20) [1] 5180000000000003 > as.character(x) [1] "5.18e+15" I thought it was because, when x is numeric, as.character(x) represents x rounded to 15 significant digits. > print(signif(x, 15), digits=20) [1] 5180000000000000.0000 > as.numeric(as.character(x)) == signif(x, 15) [1] TRUE The documentation for 'as.character' in R states this in "Details" section. 'as.character' represents real and complex numbers to...
2008 Feb 01
1
argument order for Math2 group functions in R 2.6.x (PR#10679)
Full_Name: Ben Hansen Version: 2.6.1 OS: Windows Submission from: (NULL) (66.93.3.101) Hi, In R 2.6.0 or 2.6.1 on Windows, I get the following upon opening the GUI (no previous commands or special settings): > signif(digits=4, x=1/3) [1] 4 It seems to be taking 4 to be the "x" argument, the number to be rounded. However, my understanding (perhaps mistaken) was that it should respond as follows: > signif(digits=4, x=1/3) [1] 0.3333 (This last is what I get from R 2.5.0 running on the same machine...
2002 Feb 28
1
trying to build matrix for tests...
..., value = c("resid", "group")) : attempt to set an attribute on NULL and > attach( rt ) Error in attach(rt) : attach only works for lists and data frames the code that I use to build the matrix is : # break up the classes into cats and test for departure from zero signif <- symnum(fit3sls[[2]]$residuals, corr = FALSE, na = FALSE, cutpoints = c(-5,.1,.2,.3,.4, 5), symbols = c("A","B","C","D","E")) rt <- noquote( cbind( fit3sls[[2]]$residuals, signif ) ) colnames(table) <- c("resid",&quo...
2019 Mar 28
0
default for 'signif.stars'
Hi Martin, I take your point - but I'd argue that significance stars are a clumsy solution to the very real problem that you outline, and their inclusion as a default sends a signal about their appropriateness that I would prefer R not to endorse. My preference (to the extent that it matters) would be to see the significance stars be an option but not a...
2014 Jan 06
1
Signif. codes
My question is about the "Signif. codes" , the output when I run matcoef =cbind(fit$par, se.coef,tval,2*(1-pnorm(abs(tval)))) dimnames(matcoef)=list(names(tval),c("Estimate","Std.Error","t value","pr(>|t|)")) cat("\nCoefficient(s):\n") printCoefmat(matcoef, digits=4,...
2009 Dec 22
1
Sweave: font problems with Signif. codes lines
...x 2.7, R 2.9.2] In an Sweave document, I'm displaying the results of car:::Anova() tests, that look like this in the generated .tex file: \begin{Soutput} Type III MANOVA Tests: Pillai test statistic Df test stat approx F num Df den Df Pr(>F) (Intercept) 1 0.86 90.38 4 60 <2e-16 *** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 \end{Soutput} When processed with pdfLaTeX, using \usepackage{Sweave} the Signif. codes lines appears as Signif. codes: 0 S***S 0.001 S**S 0.01 S*S 0.05 S.S 0.1 S S 1 except that the Ss have funny accents. If I try again, using the noae opti...