Displaying 8 results from an estimated 8 matches for "resmat".
Did you mean:
remat
2004 Mar 19
2
How to collect trees grown by rpart
...e trees grown by rpart fits in an array,
> in order to be able to use them later to predict new data. I have
> tried to use parse and eval to do this, without success. I'd be
> very grateful if someone could explain how to do it.
>
> The kind of thing I hope to do is:
>
> resmat=array(NA, 100)
> for (run in 1:100) resmat[run]=rpart(y~., data=train[run])
>
> So that, later, I can do:
> for (run in 1:100) pred[run]=predict(resmat[run], newdat)
>
> But, resmat[run] does not work, even though it saves the cptables.
>
> Thanks, in advance,
>
>...
2001 Jul 18
1
hypothesis testing in models
...n
in the archives, but nothing apart from that. Is it there or am I missing
something? If it is not there, is there a specific reason for that?
I am aware that the required code is not special or long, but the one I could
come up with is rather ugly and a pain to use:
htest <- function(object, resmat, target = 0, level = 0.95, n = 0) UseMethod("htest")
# Testing liner restrictions of the form: resmat %*% cfs = target
# resmat: matrix/vector of restriction multipliers (i x k) ARRAY!!
# target: restriction value vector/scalar (k)
htest.lm <- function(object, resmat, target = 0...
2006 Jan 08
1
confint/nls
...ter/more efficient ways than my slogging through
one case at a time ...
apologies for the long message, but I am temporarily cut
off from any way to post these files to the web.
cheers
Ben Bolker
code that tests various combinations of numbers of parameters
and algorithms:
-----------
resmat = array(dim=c(3,2,3),
dimnames=list(npar=1:3,c("fit","confint"),c("default","plinear","port")))
resmat.fix <- resmat
## sim. values
npts=1000
set.seed(1001)
x = runif(npts)
b = 0.7
y = x^b+rnorm(npts,sd=0.05)
a =0.5
y2 = a*x^b+rnorm(npts,sd=0.05)...
2008 Oct 25
1
Filling symbols in xyplot
...quot;,"UL","UU","UU","UU","UU","UU","UU",
"CU","CU","CU","CU","CU","CU")
splabel=c("A","B","C","D","E","F")
resmat=data.frame(Effect, Per, Spp, Treat)
## Graphing functions
library(lattice)
key.aug <- list(corner=c(0,0.93), text = list(levels(resmat$Treat)),
points = list(pch = c(21,2,21,2), cex=c(1.2,1,1.2,1), col =
c("red3","red","black","lightgrey")), lw...
2006 Mar 23
1
AIC mathematical artefact or computation problem ?
Dear R user,
I have made many logistic regression (glm function) with a second order
polynomial formula on a data set containing 440 observation of 96
variables. I?ve made the plot of AIC versus the frequency
(presence/observations) of each variable and I obtain a nearly perfect
arch effect with a symmetric axe for a frequency of 0.5 . I obtain the
same effect with deterministic data. Maybe
2013 Nov 01
1
Package(s) for making waffle plot-like figures?
Dear all,
I am trying to make a series of waffle plot-like figures for my data to
visualize the ratios of amino acid residues at each position. For each one
of 37 positions, there may be one to four different amino acid residues. So
the data consist of the positions, what residues are there, and the ratios
of residues. The ratios of residues at a position add up to 100, or close
to 100 (more on
2009 Jun 22
1
How to make try to catch warnings in logistic glm
...catch:
Warning in glm.fit(x = X, y = Y, weights = weights, start = start,
etastart = etastart, ?:
?algorithm did not converge
Warning in glm.fit(x = X, y = Y, weights = weights, start = start,
etastart = etastart, ?:
?fitted probabilities numerically 0 or 1 occurred
script
ngood<-28
nbad<-21
resmat<-"DFr"
j<-0
nsim<-100
res<-matrix(NA, nrow=nsim, ncol=6)
ow <- options("warn")
options(warn= 1)
outcome<-rep(c("G","B"), times=c(ngood, nbad))
outcome<-as.factor(outcome)
agood<-rep(c(0,1), times=c(27,1))
abad<-rep(c(0,1), times=c(1...
2007 May 08
2
Looking for a cleaner way to implement a setting certain indices of a matrix to 1 function
I wrote an ugly algorithm to set certain elements of a matrix to 1
without looping and below works and you can see what
The output is below the code.
K<-6
lagnum<-2
restrictmat<-matrix(0,nrow=K,ncol=K*3)
restrictmat[((col(restrictmat) - row(restrictmat) >= 0 ) &
(col(restrictmat)-row(restrictmat)) %% K == 0)]<-1
restrictmat[,(lagnum*K+1):ncol(restrictmat)]<-0
restrictmat