Displaying 20 results from an estimated 600 matches similar to: "How to calculate means for multiple variables in samples with different sizes"
2004 Apr 07
4
Problems with rlm
Dear all,
When calling rlm with the following data, I get an error. (R v.1.8.1,
WinXP Pro 2002 with service pack 1.)
> d <- na.omit(data.frame(CPRATIO, HEIGHTZ, FAMILYID))
> c <- tapply(d$CPRATIO, d$FAMILYID, mean)
> h <- tapply(d$HEIGHTZ, d$FAMILYID, mean)
> c
1 2 3 6 7 9 10
11
6.000000 2.500000 3.250000
2007 Jul 27
1
exporting character vector to text files
R-help,
I have a character vector whose elements are the names of matrixes.
Something like this:
> test <- ls(pattern="Oki")
[1] "aaOki" "aOki" "bOki" "c1Oki" "c2Oki" "c3Oki"
"cOki" "dOki" "eOki" "fOki" "gprsOki" "hOki"
2011 Jan 27
3
how to divide each element of a matrix by a specific value per column
Hi,
I'd like to divide each element of a matrix by a specific value per column. These specific values are stored in a list. For example:
> x <- c(1,2,3,4,5)
> y <- matrix(c(1:30), nrow = 6)
Now I want to divide each element in y[,1] by x[1], y[,2] by x[2] etc. I have tried this
> my_function <- function(data, ind) data/ind
> apply(y, 2, my_function, x)
[,1] [,2]
2010 Dec 08
1
I want to get smoothed splines by using the class gam
Hi all,
I try to interpolate a data set in the form:
time Erg
0.000000 48.650000
1.500000 56.080000
3.000000 38.330000
4.500000 49.650000
6.000000 61.390000
7.500000 51.250000
9.000000 50.450000
10.500000 55.110000
12.000000 61.120000
18.000000 61.260000
24.000000 62.670000
36.000000 63.670000
48.000000 74.880000
I want to get smoothed splines by using the class gam
The first way I tried , was
2004 Dec 29
1
Discrepancy between intervals.lme and coef.lme
I'm using R on Windows v2.0.1 with the nlme package (v3.1-53) and am finding some unexpected discrepancies in the output of intervals.lme and coef.lme. I've included a toy dataset at the end, but briefly, the data are longitudinal data from couples in marital therapy. Each spouse's relationship satisfaction is measured 4 times; I've fit both linear and quadratic models to the
2016 May 25
1
Slow RAID Check/high %iowait during check after updgrade from CentOS 6.5 -> CentOS 7.2
On 2016-05-25 19:13, Kelly Lesperance wrote:
> Hdparm didn?t get far:
>
> [root at r1k1 ~] # hdparm -tT /dev/sda
>
> /dev/sda:
> Timing cached reads: Alarm clock
> [root at r1k1 ~] #
Hi Kelly,
Try running 'iostat -xdmc 1'. Look for a single drive that has
substantially greater await than ~10msec. If all the drives
except one are taking 6-8msec, but one is very
2010 Aug 30
1
Help With Post-hoc Testing
I am trying to do post-hoc tests associated with a repeated measures
analysis with on factor nested within respondents.
The factor (SOI) has 17 levels. The overall testing is working fine, but I
can''t seem to get the multiple comparisons to work.
The first step is to "stack" the data.
Then I used "lme" to specify and test the overall model.
Finally
2012 Sep 04
3
unexpected (?) behavior of sort=TRUE in merge function
All,
I realize from the archive that the sort argument in merge has been subject to discussion before, though I couldn't find an explanation for this behavior. I tried to simplify this to (kind of) minimal code from a real example to the following (and I have no doubts that there are smart people around achieving the same with smarter code :-)). I'm running R 2.15.1 64bit under MS Windows
2010 May 04
1
make a column from the row names
Dear All,
> avglog
01/11/09 02/11/09 03/11/09 04/11/09
9.750000 4.500000 4.500000 8.666667
> avglog1 <- data.frame(avglog)
> avglog1
avglog
01/11/09 9.750000
02/11/09 4.500000
03/11/09 4.500000
04/11/09 8.666667
The first column isnt a column, It's the row names. I makeing a column from
the row names by using the following
> value1$Day <- rownames(value1)
>
2011 May 01
1
Mean/SD of Each Position in Table
I have 100+ .csv files which have the basic format:
> test
X Substance1 Substance2 Substance3 Substance4 Substance5
1 Time1 10 0 0 0 0
2 Time2 9 5 0 0 0
3 Time3 8 10 1 0 0
4 Time4 7 20 2 1 0
5 Time5
2009 Sep 14
8
10 Node OCFS2 Cluster - Performance
Hi,
I am currently running a 10 Node OCFS2 Cluster (version 1.3.9-0ubuntu1)
on Ubuntu Server 8.04 x86_64.
Linux n1 2.6.24-24-server #1 SMP Tue Jul 7 19:39:36 UTC 2009 x86_64
GNU/Linux
The Cluster is connected to a 1Tera iSCSI Device presented by an IBM
3300 Storage System, running over a 1Gig Network.
Mounted on all nodes: /dev/sdc1 on /cfs1 type ocfs2
2004 Dec 10
1
subset bug?
I ran into a problem with "subset" while working at home that I am not sure is a bug or not. I defined a custom function to take a data frame of tree positions, sizes, and types (containing the columns TRT, COMP, PLOT, X, Y, DBH and CON) and wanted to make a stem map of the plot using different symbols and colors to represent the different types of tree stems. I copied a bit of the
2004 Apr 28
3
Possible bug in foreign library import of Stata datasets
Concerning this article, Christopher Zorn, "Generalized Estimating
Equation Models for Correlated Data: A Review with Applications." 2001.
American Journal of Political Science 45(April):470-90.
The author very kindly provides data for replication on his web page:
http://www.emory.edu/POLS/zorn/Data/GEE.zip.
I've been comparing the Professor Zorn's results obtained with
2005 Aug 15
1
png and resolution (PR#8066)
Full_Name: Knut krueger
Version: 2.1.1
OS: xp Home
Submission from: (NULL) (149.225.134.34)
In the png function the value res seems to be inactive:
bmp(filename = "c:/r/Rplot%03d.bmp", width = 1920, height = 1920, pointsize =
48, bg = "white", res = 2400)
result:
witdh/heigth = 1920 <> 20.32 mm
ppi=2400
Results as expected
png(filename =
2013 Jan 05
5
Need help on dataframe
Dear R users, I came up to a problem by taking means (or other summary
statistics) of a big dataframe.
Suppose we do have a dataframe:
ID V1 V2 V3 V4 ........................ V71
1 6 5 3 2 ........................ 3
2 3 2 2 1 ........................ 1
3 6 5 3 2 ........................ 3
4 12 15 3 2 ........................ 100
2009 Apr 06
1
Comparing 2 slopes of 2 regression lines
Hello everyone,
I would like to test two regression slopes:do they differ significantly?The data and commands I've used so far:
x<-8.5:32.5 #Vektor x
y<-c( NA , NA , 5.67 , 6.53 , 6.83, 7.41 , 7.93 , 8.5 , 8.86, 9.46 , 9.82 , 10 ,10.35 , 10.7 ,11.03 ,11.37 ,11.61 ,11.84, 12.12, 12.39 ,12.67 ,12.96, 13.28 ,13.47, 13.65) #Vektor y
(regression<-lm(y~x))
summary(regression)
2013 Feb 27
2
temp seems ineffective in SANN (optim)
I am trying to control the behavior of the SANN method in optim (R
2.14.1) via control$temp. In my toy tests it works; in my real use, it
doesn't.
As far as I can tell my code with different temp values is loaded; I
even traced into the function that calls optim and verified temp had the
value I had set.
Could the fact that I have NaN's coming back from the objective function
be a
2006 Feb 10
8
Fitdistr and MLE for parameter lambda of Poisson distribution
Hello!
I would like to get MLE for parameter lambda of Poisson distribution. I
can use fitdistr() for this. After looking a bit into the code of this
function I can see that value for lambda and its standard error is
estimated via
estimate <- mean(x)
sds <- sqrt(estimate/n)
Is this MLE? With my poor math/stat knowledge I thought that MLE for
Poisson parameter is (in mixture of LaTeX
2008 May 29
1
plotting zoo using datetime as xlim
is there a way to use the actual index value for plotting zoo objects
this is the way that the index is set up and a sample range of what I would
like to plot
01/01/06 00:00:00 - 01/01/06 23:45:00
{
library(zoo)
# chron
library(chron)
fmt.chron <- function(x) {
chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x))
}}
x <- structure(c(15.57, 15.5,
2005 Jul 12
5
High resolution plots
Is there any possibility to get high resolution plots in a windows xp
system?
I tried it with the device function png(filename =
"c:/r/highresplot%d.png",pointsize=12, res=900)
but when I try to set: width = 480, height = 480 or pointsize = 12,
the text is not scaled in the same way as the plots.
with regards
Knut Krueger
http://www.biostatistic.de