Displaying 20 results from an estimated 500 matches similar to: "Recursive Indexing Failed"
2011 Sep 01
4
Question about BIC of two different regression models? how should we compare two regression models?
Hi All,
In order to compare two different logistic regressions, I think I need to compare them based on their BIC values, but I am not sure if the smaller BIC would mean a better model or the reverse is true?
Thanks a lot,Andra
[[alternative HTML version deleted]]
2010 Oct 22
2
create sequence of numbers
Hello.
I want to create some sequence of numbers . So far I used sequence which does
not work always
seq(CRagent[[1]]$xy[1],CRagent[[2]]$xy[1],by=0.01)
Error in seq.default(CRagent[[1]]$xy[1], CRagent[[2]]$xy[1], by = 0.01) :
wrong sign in 'by' argument
Calls: seq -> seq.default
if the parameters are in descending form.
The ideal would be to be able to use seq like this
2010 Nov 20
2
Merge two ggplots
Hello everyone.
I am using ggplot and I need some help to merge these two plots into one.
plot_CR<-function(x,y,agentid,CRagent){
library(ggplot2)
agent<-CRagent[[agentid]] # To make following expression shorter
ggplot((data.frame(x=CRX,y=CRY,sr=agent$sr)))+
geom_point(aes(x,y,colour=cut(sr,c(0,-10,-20,-30,-40,-50,-60,-70,-80))))+
geom_text(aes(x,y,color=cut(sr,
2010 Nov 17
1
Give me all operator
Hello is there in R any operator that give you all the data of a matrix
for example in matlab
x(2,3) returns the 2ndth row and 3rdth column
x(2,:) returns all the columns of the 2nd row.
In R now I would like to print all the
CRagent[[i]][2]
CRagent[[:]][2] doesnot work of course. Other option is to make a loop with an index i that spans from 1:last element of CRagent[[]] but this is not
2012 Feb 22
4
Week number from a date
Hi
My data looks like this
startDate="2008-06-01"
dateRange =c( "2008-10-01","2008-12-01")
Is there any method to find the week number from the startDate range
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html
Sent from the R help mailing list archive at Nabble.com.
2011 Mar 24
1
fraction with timelag
Dear r-help,
I'm having this DF
df <- data.frame(id = 1:6,
xout = c(1234, 2134, 234, 456, 324, 345),
xin= c(NA, 34,67,87,34, NA))
and would like to calculate the fraction (xin_t / xout_t-1)
The result should be:
# NA, 2.76, 3.14, 37.18, 7.46, NA
I am sure there is a solution using zoo... but I don't know how...
Thanks for any help!
Patrick
2011 May 03
2
Overlapping x axes using Lattice
Hi R users
I apologise in advance for this question as I suspect it is simple and
perhaps others have had this problem.
I am struggling to sort out how to fix the x axes so that the labels
don't overlap.
I have put the following example together to show my problem.
library(lattice)
titre <- as.factor(rep(c(10999,20999,30999,40999,50999,60999,
2008 Nov 20
2
Removing rows with rowsums==0 (I can't figure this out)
##I want to remove the rows where the row sums are zero and this is as
far as I have gotten
ffg <- (structure(list(CD = c(0, 0, 0, 0, 3.125, 0, 0, 0, 0, 1.6, 3.125,
0, 0, 6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.125, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.6, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1.6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3.125, 0, 0, 0, 0, 0, 0, 0, 0,
2011 Jan 06
1
Find and remove elemnts of a data frame
Dear all,
I have a data frame that is created like that
data.frame(x=CRX[-1],y=CRY[-1],z=CRagent[[1]]$sr)
the output looks like
45 116 162 -30.89105988567164
46 128 79 -42.66296679571184
47 180 195 -30.45626175641315
48 114 83 -45.26843476475688
49 118 73 -46.85389245327003
How can I select only the rows that their third column is higher that -45?
This will return the following
116 162
2010 Nov 22
1
plot inside function does not work
Hello everyone,
when I commit a plot using console(command line?) plot works fine. I have created a function that plots based on the input. This function is called plot_shad. When I call this function alone in the command line I get my plot.
Then I tried to use another function as depicted_below to do some calculation before calling the function that does the plotting.
2012 Mar 20
2
cv.glmnet
Hi, all:
Does anybody know how to avoid the intercept term in cv.glmnet coefficient?
When I say "avoid", it does not mean using coef()[-1] to omit the printout
of intercept, it means no intercept at all when doing the analysis. Thanks.
[[alternative HTML version deleted]]
2011 Jul 22
4
glmnet with binary logistic regression
Hi all,
I am using the glmnet R package to run LASSO with binary logistic
regression. I have over 290 samples with outcome data (0 for alive, 1 for
dead) and over 230 predictor variables. I currently using LASSO to reduce
the number of predictor variables.
I am using the cv.glmnet function to do 10-fold cross validation on a
sequence of lambda values which I let glmnet determine. I then take
2011 Sep 13
6
Force regression line to a 1:1 relationship
Hello,
I appreciate this is likely to be an easy question. I am trying to obtain
the residuals from a linear regression where the line is forced to have a
1:1 relationship.
An example of the data:
A<-c(0.9803922, 1.3850416, 0.8241758, 0.0000000, 0.4672897, 1.1904762,
0.0000000, 0.9456265,
1.5151515)
B<-c(1.3229572, 1.9471488, 1.3182674, 0.7007708, 1.0185740, 1.0268562,
0.8695652,
2011 Dec 06
1
varaince explined of a regression tree using ctree
Dear,
I would like know the way to calculate the variance explained of a regression tree. I use the function "ctree" from library "party"
many thanks
[[alternative HTML version deleted]]
2011 Sep 27
1
binomial logistic regression question
Dear subscribers,
I am looking for a function which would allow me to model the dependent
variable as the number of successes in a series of Bernoulli trials. My data
looks like this
ID TRIALS SUCCESSESS INDEP1 INDEP2 INDEP3
1 4444 0 0.273 0.055 0.156
2 98170 74 0.123 0.456 0.789
3 145486 30 0.124
2011 Aug 10
1
studentized and standarized residuals
Hi,
I must be doing something silly here, because I can't get the studentised
and standardised residuals from r output of a linear model to agree with
what I think they should be from equation form.
Thanks in advance,
Jennifer
x = seq(1,10)
y = x + rnorm(10)
mod = lm(y~x)
rstandard(mod)
residuals(mod)/(summary(mod)$sigma)
rstudent(mod)
2011 Aug 11
1
Cv.glment question -- why giving me an error
Hi All,
I am trying to run cv.glmnet(x,y,family="multinomial", nfolds =4) and I only have 8 observations and the number of features I have is 1000, so my x matrix is 8 by 1000 and when I run the following, I get this error, I am not sure what is causing this problem.
Error in predmat[which, , seq(nlami)] = preds : number of items to replace is not a multiple of replacement length
Can
2011 May 04
2
Box-Cox transformation in R
Hi,
Could any one please help how I can transform data based on Box-Cox Transformations in R.
Any helps will be much appreciated.
thanks,
Kagba
[[alternative HTML version deleted]]
2011 May 29
1
dynamic programming
Dear members of R forum,
I'm trying to perform a simply dynamic programming model in R, following the
reccomendations of Soetart & Herman (A practical guide to ecological
modeling). However, I've obtained a number of problems, that I'm unable to
solve (even thoughI've tried during at least 2 hours). Can anyone help me?
Many thanks
> ccrit <- 0
> cmax <- 5
>
2011 Jun 21
1
working with sparse matrix
Hi, I have a 500x 53380 sparse matrix and I am trying to dichotomize it.
Under sna package I have found event2dichot yet it doesnt recognize sparse
matrix and requires adjacency matrix or array. I tried to run a simple loop
code
for (i in 1:500)
for (j in 1:53380)
if (matrix[i,j]>0) matrix[i,j]=1
yet this takes a lot of time to run, I mean it has been last two hours and
it is stil running.