Displaying 20 results from an estimated 30000 matches similar to: "Problem passing a statistical model as an argument"
2010 Feb 17
1
strangeness in Predict() {rms}
Hi,
Running the following example from ?Predict() throws an error I have never
seen before:
set.seed(1)
x1 <- runif(300)
x2 <- runif(300)
ddist <- datadist(x1,x2); options(datadist='ddist')
y <- exp(x1+ x2 - 1 + rnorm(300))
f <- ols(log(y) ~ pol(x1,2) + x2)
p1 <- Predict(f, x1=., conf.type='mean')
Error in paste(nmc[i], "=", if (is.numeric(x))
2009 Jun 13
1
Hmisc summarize() with level "" in by variable
I was using summarize() in a data set in which one of the levels of
the by variable was "". The summary statistic was consistently off by
one level and the "" level was not in the output data frame. I tried
to report it as a bug, but I could not log into the Hmisc bug
reporting website to do so. I searched for this in the email
archives. If it's there, I failed to find
2010 Oct 05
3
reorder always returns "ordered"
Or at least is seems that way to me. It's not a big problem, but the
behavior doesn't match the documentation. (I think r-help is the
place to report this. )
> x <- factor(1:5)
> x.ro <- reorder(x, rnorm(5))
> is.ordered(x.ro) # should be FALSE according to ?reorder
[1] TRUE
>
> x.ro <- reorder(x, rnorm(5), ordered=FALSE)
> is.ordered(x.ro) # should be FALSE
2010 Apr 23
2
Deferred Default Marker
I've finally narrowed down a puzzling problem: here is the short test
case.
tmt34% R --vanilla
R version 2.10.0 (2009-10-26)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
> temp <- matrix(runif(50), ncol=2)
> t(temp) %*% temp
[,1] [,2]
[1,] 7.916016 6.049698
[2,] 6.049698 7.650694
> library(kinship)
Loading required package:
2008 May 30
2
scoping problem when calling lm(precomputed formula, weights) from function (PR#11540)
I've run into a scoping problem in R.
I'm calling a function that
* creates a formula
* calculates a weight vector
* calls lm with that formula and weights
This fails.
Here's a simplified reproduce example:
# f works, g doesn't, h is a workaround
rm(w)
data <- data.frame(y=runif(20), x=runif(20), z=runif(20))
f <- function(k){
w <- data$z^k
coef(lm(y~x, data
2010 Nov 29
3
Replacing several rows of a matrix at once
Hello Folks. This must be a silly question with a (not) obvious (to me)
answer.
Consider this:
tmp <- matrix(1:200, nrow = 20)
vec <- 300:309
tmp[9,] <- vec # replacing one row works fine
p <- c(3, 11, 17)
tmp[p,] <- vec
# replacing multple rows pastes the values down a column and recycles vec.
What I want to do is replace multiple rows simultaneously at once. I
suppose I can
2009 Jul 18
5
Hmisc, Design, summary.Design plot- changing confidence intervals, adding color or decreasing font size
Hi,
1. I want 95% not 99% confidence intervals in my summary.Design plot using the Design package. Putting conf.int=.95 as an argument in plot does not work. The default appears to be .99 not .95 as stated in the package Design manual (p. 164).
2. My sweave chuck is below and my output is attached as well as linked here:
http://www.sonoma.edu/users/s/stanny/330A/project/ciplot.pdf
3.
2012 Apr 11
1
Problem with effects package
> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid datasets splines utils stats
[6] graphics grDevices methods base
other attached packages:
[1] effects_2.1-0 colorspace_1.1-1
[3] nnet_7.3-1
2010 Dec 06
2
less than full rank contrast methods
I'd like to make a less than full rank design using dummy variables
for factors. Here is some example data:
when <- data.frame(time = c("afternoon", "night", "afternoon",
"morning", "morning", "morning",
"morning", "afternoon", "afternoon"),
2009 Oct 30
1
quoted strings in foo.Rd rendered as â
Another anomaly from our rhel5 system, again sessionInfo() below.
When I'm logged in remotely via ssh from my macpro and view
documentation
files in my X11 window, strings in single quotes in the files are all
abbreviated as ? . The same files appear fine when rendered in X11
using the local R, and also appear fine in a terminal window on the
linux machine, so this could easily also be
2004 Dec 15
2
how to fit a weighted logistic regression?
I tried lrm in library(Design) but there is always
some error message. Is this function really doing the
weighted logistic regression as maximizing the
following likelihood:
\sum w_i*(y_i*\beta*x_i-log(1+exp(\beta*x_i)))
Does anybody know a better way to fit this kind of
model in R?
FYI: one example of getting error message is like:
> x=runif(10,0,3)
> y=c(rep(0,5),rep(1,5))
>
2010 Apr 02
1
R abrupt exit
Dear Lists:
I recently ran quite annoyance problem while running R on Ubuntu 9.10.
When running the program, the system suddenly exit from the R
session with the following warnings:
############################ #############
OMP: Hint: This may cause performance degradation and correctness
issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore
this problem and force the program
2011 Mar 14
1
Math characters in column heading using latex() in Hmisc
Hi Everybody
I want to print a latex table containing math characters in the column
heading
These are the formulae I want to use as column headings. It prints OK from
TeX
$\sum_{i}\sum_{j}C_{P,i,j,y}\times\mathit{FC}_{i}$, $XU_{alt,y}$, $n$,
$\bar{C}_{P,y}$
My plan was to create a character vector with these and later rbind the
values to them. When I create the vector like:
2009 Sep 17
1
Why S4 method is not visible from another package?
Dear All,
maybe this is something obvious, I seem to be incapable of
understanding how S4 works.
So, in package 'A' I defined a "summary" method for my class:
setMethod("summary", signature(object="ListHyperGResult"),
function(object, pvalue=pvalueCutoff(object), categorySize=NULL) {
"whatever"
})
2010 Nov 22
1
Sporadic errors when training models using CARET
Hi. I am trying to construct a svmLinear model using the "caret" package
(see code below). Using the same data, without changing any setting,
sometimes it constructs the model successfully, and sometimes I get an index
out of bounds error. Is this unexpected behaviour? I would appreciate any
insights this issue.
Thanks.
~Kendric
> train.y
[1] S S S S R R R R R R R R R R R R R R R
2010 Jun 08
2
duplicated() and unique() problems
Hi everybody
I have found something (for me at least) strange with duplicated(). I will
first provide a replicable example of a certain kind of behaviour that I
find odd and then give a sample of unexpected results from my own data. I
hope someone can help me understand this.
Consider the following
# this works as expected
ex=sample(1:20, replace=TRUE)
ex
duplicated(ex)
ex=sort(ex)
ex
2009 Dec 01
1
An R vs. SAS Discrepancy: How do I determine which is correct?
I was messing around with some data in R and SAS (the reason is
unimportant) fitting a multiple linear regression and got a
curious discrepancy. The data set is too big to post, but if
someone wants it, I can send it.
So, here are the (partial) results:
From R:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 61.11434 1.48065 41.275 < 2e-16 ***
sexWomen
2009 Oct 26
1
Unable to get Legend with survplot rms package
Hello,
I apologize for the post as I am certainly overlooking a simple
solution to my difficulties with getting a legend to print on a
survplot from the rms package.
I am plotting the following:
survplot(survest(fita), n.risk=T, conf='none', cex.n.risk=.85, dots=T,
col='gray10', lty=2)
survplot(survest(fit), n.risk=F, conf='none', add=T)
survplot(survest(fitb), n.risk=F,
2003 Nov 11
4
HMisc describe -- error with dates
Hello,
I am trying to use HMisc describe on a data frame. I have specified certain
variables as dates using, for example:
df1$aidsdate <- dates(aidsdate,format="day.mon.year", origin=c(month = 1,
day = 1, year = 1960))
When I use describe on the dataframe I get this error:
Error in Ops.dates(weights, x) : * not defined for chron objects
Has anyone had this problem? I had
2010 Nov 20
1
Grid newbie: aligning & scaling viewports
Oh Knowledgeable Ones:
I'm working on a project using grid graphics (for the first time). A toy
example is given below, run it simply with >foobar() I am wondering why the
pink dot and concentric circles are not centered on the 3-color axis system.
Further, I feel like the concentric circles don't have the intended radius -
if my math is right, the outmost circle should touch the