search for: hojsgaard

Displaying 20 results from an estimated 78 matches for "hojsgaard".

2005 Jun 20
2
Fwd: How to sample from a linear mixed model
Thanks. I wonder if there is a general way of extracting var(u) and var(e), which would be needed to simulate u and e. Clearly, one can get the estimated parameters, but is there a clever way of 'setting up' the matrices?? Best S??ren On 6/19/05, S??ren H??jsgaard <Soren.Hojsgaard at agrsci.dk> wrote: > I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has been fitted with lme(), i.e. a model y ~ N(Xb, C), where C=Z cov(u) Z' + cov(e). > I've tried to figure out how to extract C from an lme object, because that would solve my problem wh...
2010 Nov 26
3
Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)
# The result I am after is the result after a substitution in an expression, such as substitute(expression(a+b+c), list(a=1)) expression(1 + b + c) # However, the way I want to do it is for a an expression "stored as a variable" as (expr <- expression(a+b+c)) expression(a + b + c) # a) The following does not work (expr2 <- substitute(expr, list(a=1))) expr # b) - whereas this
2005 Jul 31
3
Drawing a graph with vertices and edges using tcl/tk
Dear all; I would like to draw a graph with vertices and edges, and I guess tcl/tk would be appropriate. I don't know tcl/tk but have googled for a 10-page (or so) introduction to 'getting started with tcl/tk in R' but without any luck. - Does anyone know of the existence of such a document or any other web-based material on the subject? - Does anyone have an (informative) piece of
2006 Feb 15
2
Plotting two 3-dimensional time series in a 3 x 2 plot - alternatives to par(mfrow())
I am trying to plot two 3-dimensional time series in one window (such that there will be 3 rows and 2 columns). For zoo and ts objects the par(mfrow...) option does not work. I can get xyplot to make the plots, but data are on widely different scales in the three dimensions, and xyplot uses the same scale on all y-axis which means that in some dimensions the curves will be almost horizontal lines.
2006 Aug 29
2
lattice/xyplot: plotting 4 variables in two panels - can this be done?
Hi, I would like to create a plot of y1,y2,y3,y4 against x for several subjects such that y1 and y2 are plotted against x in one panel and y3 and y4 against x in another panel. Thus if there are 3 subjects I should end up with 6 panels. Is there a simple way of doing so (i.e. without calling xyplot() several times, and then padding the results together)?? Regards S?ren
2005 Jun 19
1
How to sample from a linear mixed model
I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has been fitted with lme(), i.e. a model y ~ N(Xb, C), where C=Z cov(u) Z' + cov(e). I've tried to figure out how to extract C from an lme object, because that would solve my problem when also using the predict() function, but without any luck. Can anyone help on that?
2007 Aug 22
2
Evaluating f(x(2,3)) on a function f<- function(a,b){a+b}
Dear list I have a function and a vector, say f <- function(a,b){a+b} x <- c(2,3) I want to "evaluate f on x" in the sense of computing f(x[1],x[2]). I would like it to be so that I can write f(x). (I know I can write a wrapper function g <- function(x){f(x[1],x[2])}, but this is not really what I am looking for). Is there a general way doing this (programmatically)?
2010 Dec 08
1
Trouble Loading doBy and coin Packages
...of my Win XP system. I am?running R 2.12.0 and using Tinn-R 2.3.6.2 as my interface. When I attempt to call either the doBy or coin packages R generates an error that I do not understand and have so far not been able to resolve by searching R resources. I exchanged a couple of emails with Soren Hojsgaard who does not think the doBy error is directly related to the package itself, and he suggested that I post this problem for input from others. When the doBy package is loaded, the following error appears in the Tinn-R log: Error in length(label) : could not find function ".extendsForS3&quot...
2006 Nov 01
2
xyplot: Plotting two variables, one as points - the other as line. Can that be done without explicitly using panel functions
Hi! Consider d <- data.frame(x=1:10,y=5+1:10, yf=rnorm(10,5+1:10)) x y yf 1 1 6 5.268621 2 2 7 8.623896 3 3 8 8.114830 4 4 9 10.125955 5 5 10 9.977261 ... I plot y and yf against x with xyplot(y+yf~x,data=d,col=c('red','green'),pch=c("a","b")) BUT - I would like that the plot of y against x is with type='l' and the
2005 Jul 12
10
Computer algebra in R - would that be an idea??
>From time to time people request symbolic computations beyond what D() and deriv() etc can provide. A brief look at the internet shows that there are many more or less developed computer algebra packages freely available. Therefore, I wondered if it would be an idea to try to 'integrate' one of these packages in R, which I guess can be done in more or less elegant ways... I do not know
2007 Sep 28
2
Importing only one function from a package
Dear List In a package I want to import the mApply function from the Hmisc package, and I would like to import only that function. 1) If I write "Depends: Hmisc" in the DESCRIPTION file I get the whole Hmisc package, so that is not the way to go ahead. 2) According to "Writing R extensions", sec 1.6.1 "Specifying imports and exports" I can (as I read it) simply
2007 Mar 20
4
Over-writing functions from other packages? What is a good strategy??
I am writing a package which uses the Rgraphviz package which in turn uses the graph package, but my question does not (I believe) pertain specifically to the these packages so therefore I dare to post the question here: I my package I have a function "edges" which works on some graphs I have defined. However, there is also a function "edges" (or rather a generic method) in
2010 Dec 10
1
New Installs, Same Trouble Loading doBy and coin Packages
...em. I am?running R 2.12.0 and using Tinn-R 2.3.6.2 as my >interface. When I attempt to call either the doBy or coin packages R generates >an error that I do not understand and have so far not been able to resolve by >searching R resources. > >I exchanged a couple of emails with Soren Hojsgaard who does not think the doBy >error is directly related to the package itself, and he suggested that I post >this problem for input from others. > >When the doBy package is loaded, the following error appears in the Tinn-R log: > >Error in length(label) : could not find function &q...
2003 Oct 30
0
loglm() uses only a reference to data, and not data itsel f - is that on purpose??
...the kind that loglm() was designed to handle, after all) do you really want to be carting around several copies of it around in memory? That said, do you have a suggested patch that might accommodate this refinement? Bill Venables. -----Original Message----- From: S?ren H?jsgaard [mailto:Soren.Hojsgaard at agrsci.dk] Sent: Thursday, October 30, 2003 8:10 AM To: r-help at stat.math.ethz.ch Subject: [R] loglm() uses only a reference to data, and not data itself - is that on purpose?? Dear all, Consider the following: library(MASS); data(HairEyeColor) l1 <- loglm(~ 1+2+3, data=HairEyeColor) my...
2005 Sep 02
1
tcltk - automatically moving cursor to last line of tktext box - how?
Hi; I have a program which writes lines to a tktext box (of height, say, 10) with tkinsert(txto, "end", paste(so,"\n")) I would like my program to be such that it automatically scrolls down through the text box when it is full so that I always see the last 10 lines written. Can anyone help on this? Best regards S??ren
2006 Feb 22
2
How can I see how %*% is implemented?
I would like to see how the matrix multiplication operator %*% is implemented (because I want to see which external Fortran/C routines are used). How can I do so? Best S??ren
2006 Apr 04
2
xyplot: getting data into the panel function
In xyplot, I would like to get the "data into the panel function" in the following sense: Consider xyplot(scc~time|cowidp, data=cow.s,type=c("l"), panel=function(x,y,subscripts,...){ panel.xyplot(x,y,...) vvv<-cow.s[which(!is.na(cow.s[subscripts,"mastreat"])),"time"] panel.abline(v=vvv,col="red",lwd=2) } ) If I want to use a
2006 Sep 01
1
Checking a package: "Foreign function calls without 'PACKAGE' argument:" - what must I do??
In the process of checking a package, I get the warning Foreign function calls without 'PACKAGE' argument: .Call("tr", ...) .Call("trProd", ...) See section 'System and foreign language interfaces' of the 'Writing R.. These functions are called using the wrappers trX <- function(x, package="gRcox") { .Call("tr", x,
2006 Jul 06
1
Rgraphviz: Setting the edge width
I create an undirected graph with Rgraphviz (see code below). I would like to make the edges thicker. Can anyone help on this?? Regards S?ren V <- c("A","B","C","D") E <- list(c("A","B"),c("B","C"),c("C","D"),c("D","A"),c("A","C")) Eidx
2008 May 07
1
algorithmic or automatic differentiation
Hi R People: Is there a package for automatic differentiation, please? thanks in advance, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com