similar to: creating 'all' sum contrasts

Displaying 20 results from an estimated 5000 matches similar to: "creating 'all' sum contrasts"

2010 Apr 21
5
Bugs? when dealing with contrasts
R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with
2010 Oct 12
0
general construction of 'all pairwise comparison' contrast in ANOVA
Hi R people I am using regsubsets() to fit large numbers of models and collect summary statistics in order to perform a Bayesian analysis of multi-way ANOVA with specific prior information. In general the variables have differing numbers of levels >=2. This works well but with variable of more than 2 levels there are naturally some arbitrary decisions about which treatment contrasts to
2010 Apr 01
2
pdf files in loops
I need to make a bunch of PDF files of histograms. I tried gatelist = unique(mdf$ArrivalGate) for( gate in gatelist) { outfile = paste("../", airport, "/", airport, "taxiHistogram", gate, ".pdf", sep="") pdf(file = outfile, width = 10, height=8, par(lwd=1)) title=paste("Taxi time for Arrival Gate", gate, "by
2010 Oct 01
1
'all subsets' fitting algorithm for Bayesian approach
Hi R experts I am just wondering if something is already available (or easily adaptable) to do the following. I am planning to build linear models for all possible combinations of terms, so for example if the terms are sent into a function as this string " X1 + X2 + X3 + X4 + X1:X2" I would want to build models for all possible combinations of these 5 terms, e.g. m1 <- lm( y ~
2010 Jul 20
1
Call to rgamma using .C causes R to hang
Hi, I've been trying to get this working for ages, but it causes R to hang. Here is my C code saved as test1.c # include <R.h> # include <Rmath.h> void test1 (double *x, double *result) { result[0] = rgamma(*x, 2.0); } This was compiled using R CMD SHLIB test1.c & loaded in R using: dyn.load("test1.dll") out <-
2010 Sep 07
4
minor diagonal in R
Dear all, seems that easy question but cannot find the function for that. How to get the elements of the minor diagonal of the matrix? Thanks a lot. [[alternative HTML version deleted]]
2010 Oct 29
2
R version 2-12.0 - running as 32 or as 64 bit?
Question: I installed R verison 2-12.0 on my Windows 7 (64 bit) PC. When I was installing it, it did not ask me anything about 32 vs. 64 bit. So, if I run R now - is it running as a 32-bit or a 64-bit? thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 Sep 24
1
Some questions about string processing
Hi all A couple of questions about string processing from someone who has only scratched the surface so far. 1) I am wanting to send some strings into a function to allow flexibility inside. My first idea has been e.g. auto_io <- function( var_string, factors ) { # e.g. var_string sent as "test_file.txt" factors sent as "x1 + x2 + x3" # input data_name <- get(
2009 Nov 15
2
Relase positive with log and zero of negative with 0
This is a very simple question but I couldn't form a site search quesry that would return a reasonable result set. Say I have a vector: x <- c(0,2,3,4,5,-1,-2) I want to replace all of the values in 'x' with the log of x. Naturally this runs into problems since some of the values are negative or zero. So how can I replace all of the positive elements of x with the log(x) and the
2009 Nov 11
1
Unexpected behaviour for as.date()
Hi everyone, I am trying to use the function as.date() from the "dates" package in R 2.10.0 to convert a character date to a Julian date, as follows: > as.date("02-MAY-01", order="mdy") # convert May 2, 2001 to a Julian date [1] 2May1 However, when trying to convert a character date from the year 2000 to a Julian date, I get an <NA> instead of the desired
2011 Jan 19
1
expand.grid
Hello list. I feel like an idiot. There exists a method called expand.grid which, from the documentation, appears to do just what I want, but then it doesn''t, and I can''t get it to behave. Given a dataframe dfr<-data.frame(c1=c("a", "b", NA, "a", "a"), c2=c("d", NA, "d", "e", "e"),
2011 Aug 03
1
expand.gird with constraints?
Hi, R users, Here is an example. k <- c(1,2,3,4,5) i <- c(0,1,3,2,1) if k=1, then j=0 from i if k=2, then j=0, 1 from i if k=3, then j=0, 1, 2, 3 from i if k=4, then j=0, 1, 2 from i if k=5, then j=0, 1 from i so i'd like to create a list like below. > list k j 1 1 0 2 2 0 3 2 1 4 3 0 5 3 1 6 3 2 7 3 3 8 4 0 9 4 1 10 4 2 11 5 0 12 5 1 I tried expand.grid, but I
2010 Sep 25
2
OT: What distribution is this?
Hi This is OT, but I need it for my simulation in R. I have a special case for sampling with replacement: instead of sampling once and replacing it immediately, I sample n times, and then replace all n items. So: N entities x samples with replacement each sample consists of n sub-samples WITHOUT replacement, which are all replaced before the next sample is drawn My question is: which
2011 Jan 22
4
two apparent anomalies
(1) > a = c("a","b") > mode(a) [1] "character" > b = c(1,2) > mode(b) [1] "numeric" > c = data.frame(a,b) > mode(c$a) [1] "numeric" (2) > a = c("a","a","b","b","c") > levels(as.factor(a)) [1] "a" "b" "c" > levels(as.factor(a[1:3])) [1]
2014 Jan 11
1
Fortran BLAS giving bad results
Hello r-devel, When compiling Fortran code containing BLAS functions and calling it using dyn.load, I am getting incorrect results. A small example with which I can reproduce the problem is below. I am running on OSX Mavericks (upgraded R, Xcode, etc per instructions on this list), but I do not think it is related since the check on my "blupsurv" package on r-forge seems to be showing
2010 Nov 16
4
DBLEPR?
Ravi Varadhan and I have been looking at UCMINF to try to identify why it gives occasional (but not reproducible) errors, seemingly on Windows only. There is some suspicion that its use of DBLEPR for finessing the Fortran WRITE() statements may be to blame. While I can find DBLEPR in Venables and Ripley, it doesn't get much mention after about 2000 in the archives, though it is in the R FAQ
2010 Nov 16
4
DBLEPR?
Ravi Varadhan and I have been looking at UCMINF to try to identify why it gives occasional (but not reproducible) errors, seemingly on Windows only. There is some suspicion that its use of DBLEPR for finessing the Fortran WRITE() statements may be to blame. While I can find DBLEPR in Venables and Ripley, it doesn't get much mention after about 2000 in the archives, though it is in the R FAQ
2010 May 28
3
Gelman 2006 half-Cauchy distribution
Hi, I am trying to recreate the right graph on page 524 of Gelman's 2006 paper "Prior distributions for variance parameters in hierarchical models" in Bayesian Analysis, 3, 515-533. I am only interested, however, in recreating the portion of the graph for the overlain prior density for the half-Cauchy with scale 25 and not the posterior distribution. However, when I try:
2010 Oct 25
2
R-Fortran question (multiple subroutines)
Dear R-helpers, apologies if this is somewhere in a manual, I have not been able to find anything relevant. I run Windows Vista. I have some Fortran code in a subroutine, and have no problem calling this from R with .Fortran, compiling the code either with 'R CMD SHLIB' or independently with gfortran. But is it possible to have more than one subroutine in my source file, one depending
2010 Oct 26
5
cube root of a negative number
Hi, This might be me missing something painfully obvious but why does the cube root of the following produce an NaN? > (-4)^(1/3) [1] NaN > As we can see: > (-1.587401)^3 [1] -4 Thanks! Greg