Displaying 20 results from an estimated 1200 matches similar to: "calculating p-values of columns in a dataframe"
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 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
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],
2009 May 08
0
why doesn't t.test value include standard error
Hello, everybody!
I'm back to ask the obvious on behalf of the silent majority :)
Today a student asked me "what standard error was used in this t.test
output". I looked into it and was a little surprised that a t.test
output object does not have a "slot" for the standard error. Of
course, we can reconstruct the se=mu-hat/t, but I was surprised.
Do you think it would
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 Dec 14
2
train nnet
Hi R-helpers,
Can some one tell me how to train 'mynn' of this type?:
mynn <- nnet(y ~ x1 + ..+ x8, data = lgist, size = 2, rang = 0.1,
decay = 5e-4, maxit = 200)
I assume that this nn is untrained, and to train I have to split the
original data into train:test data set,
do leave-one-out refitting to refine the weights (please straighten
this up if I was wrong).
I just don't know
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9.
I've been experimenting with plotmath.
I wish it were easier to combine expressions in plotmath with values
from the R program itself. There are two parameters in the following
example, the mean "mymean" and standard deviation "mystd". I am able
to use bquote to write elements into the graph title like
mu = mymean
and R will
2014 Feb 05
1
ldb segment fault. Problem on joining as a DC member.
Dear All,
Need some help as I was trying to follow the guide below.
https://wiki.samba.org/index.php/Samba4/HOWTO/Join_a_domain_as_a_DC
Until the steps of
ldbsearch -H /usr/local/samba/private/sam.ldb '(invocationid=*)'
--cross-ncs objectguid
and my ldbsearch reply with such a result.
ldb: unable to dlopen /usr/lib64/samba/ldb/acl.so :
/usr/lib64/ldb/libreplace.so: version
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody
When one is working with complex matrices, "transpose" very nearly
always means
*Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]).
One often writes A^* for the Hermitian transpose.
I have only once seen a "real-life" case
where transposition does not occur simultaneously with complex conjugation.
And I'm not 100% sure that that wasn't a
2009 Sep 25
1
R CMD INSTALL --build: Folders /inst and /etc not in zip-file and WindowsXP locks /library/[package]/etc/
Dear R users,
My set-up: OS=Windows XP, R-2.9.2, Rtools210
I faced the follwing problem with the package compilation: There is no
"/inst" or "/etc" subdirectory in the package-zip-file. And the content of
the "/etc" subdirectory is lost, too. I tried a simplified "test" package.
The "test" package has the following structure (see also attachement:
2008 Jul 08
6
Question: Beginner stuck in a R cycle
Dear All,
I have a database of 200 observations named myD.
In the dataframe there are a column named code (with codes varying from 1 to 77), a column named "prevalence" with some quantitative measurements are given and an column named Pr_mean, with no values.
I would like to set a cycle to compute the average of prevalence values for each different code and store the averages under the
2009 May 26
2
Problem with fractional seconds
Dear List,
I am having problems converting a file with fractional seconds to class POSIXct. I have set my options to include digits.secs and my format to just time, but my output is the current date with my time lacking the fractions of a second. For example:
options(digits.secs=3)
t<-c("06:00:00.100","06:00:01.231")
myt<-as.POSIXct(t,format="%H:%M:%S")
2002 Nov 25
3
Full enumeration, how can this be vectorized
Hi all,
I am currently using the code snippet below to minimize a function which I
wasn't able to minimize properly with optim (cliffy surface, constraints,
poles). Obviously this iteration is probably the poorest way of implementing
such a function and it is expectedly slow. I've already written some
vectorized functions, but I'm afraid that I'm missing the "big
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
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
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),
2013 May 01
2
significantly different from one (not zero) using lm
Hello,
I am work with a linear regression model:
y=ax+b with the function of lm.
y= observed migration distance of butterflies
x= predicted migration distance of butterflies
Usually the result will show
if the linear term a is significantly different from zero based on the
p-value.
Now I would like to test if the linear term is significantly different from
one.
(because I want to know
2012 Jun 15
0
argument "x" is missing, with no default - Please help find argument x
R programming question, not machine learning, although that's the content.
Apologies to all for whom the following code is eye-burning. I am using
foreach() to run a simulation on a randomForest model (actually conditional
randomForest ... "party" package). The simulation is in two dimensions.
examining how "mtry" and "ntrees" are related in terms of predictive
2017 Jul 11
0
Problems with time formats when importing data using readHTMLTable
> On Jul 11, 2017, at 6:25 AM, Cristina Silva <csilva at ipma.pt> wrote:
>
> Dear Jeff,
>
> I am sorry, I didn't notice that it was not plain text. I hope that it is now in the correct format. I explain the problem again, now with more detais.
> I am collecting the track positions of our research vessel from www.marinetraffic.com. In the page, the data appear in a
2004 Apr 01
5
boot question
What in the world am I missing??
> x<-rnorm(20)
> mean(x)
[1] -0.2272851
> results<-boot(x,mean,R=5)
> results[2]
$t
[,1]
[1,] -0.2294562
[2,] -0.2294562
[3,] -0.2294562
[4,] -0.2294562
[5,] -0.2294562
Jeff Morris
Ortho-Clinical Diagnostics
A Johnson & Johnson Co.
Rochester, NY
Tel: (585) 453-5794
[[alternative HTML version deleted]]