Displaying 20 results from an estimated 1000 matches similar to: "working with sparse matrix"
2011 May 09
3
Recursive Indexing Failed
Dear all,
I would like to ask your help concerning an error message I get.
I have the following struct
str(CRagentInTime[[1]])
List of 2
$ timelag: int 0
$ CRagent:List of 50
..$ :List of 3
.. ..$ CRmap: num [1:256, 1:256] NA NA NA NA NA NA NA NA NA NA ...
.. ..$ xy : num [1:2] 10 177
.. ..$ sr : num [1:49] -94.9 -92.8 -79.5 -97.6 -78.4 ...
and I wanted to select all the sr fields
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]]
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]]
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 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
2023 Nov 03
1
[EXTERNAL] RE: I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Yes, that will halve the number of multiplications.
If you?re looking for such optimisations then you can also consider ifelse(G=='male', 65L, 58L). That will definitely use less time & memory if WC is integer, but the trade-offs are more complicated if WC is floating point.
Regards,
Jorgen Harmse.
From: avi.e.gross at gmail.com <avi.e.gross at gmail.com>
Date: Friday,
2023 Nov 03
2
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Just a minor point in the suggested solution:
df$LAP <- with(df, ifelse(G=='male', (WC-65)*TG, (WC-58)*TG))
since WC and TG are not conditional, would this be a slight improvement?
df$LAP <- with(df, TG*(WC - ifelse(G=='male', 65, 58)))
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Jorgen Harmse via
R-help
Sent: Friday,
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,
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 13
1
Rcpp too good to be true?
Hello all,
I've been working on a package to do various things related to the
Conway-Maxwell-Poisson distribution and wanted to be able to make fast
random draws from the distribution. My R code was running quite slow so I
decided to give Rcpp a bash. I had used it before but only for extremely
basic stuff and always using inline. This time I decided to give making a
proper package a go.
2023 Nov 03
1
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
df$LAP <- with(df, ifelse(G=='male', (WC-65)*TG, (WC-58)*TG))
That will do both calculations and merge the two vectors appropriately. It will use extra memory, but it should be much faster than a 'for' loop.
Regards,
Jorgen Harmse.
------------------------------
Message: 8
Date: Fri, 3 Nov 2023 11:10:49 +1030
From: "Md. Kamruzzaman" <mkzaman.m at gmail.com>
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 Sep 02
2
misclassification rate
Hi users
I'm student who is struggling with basic R programming. Would you please
help me with this problem.
"My english is bad" I hope that my question is clear:
I have a matrix in wich there are two colmns( yp, yt)
Yp: predicted values from my model.
yt: true values ( my dependante variable y is a categorical;3 modalities
(0,1,2)
I don't know how to procede to calculate the
2011 Sep 08
3
generate randomly a value of a vector
Hi everyone,
I have a zero vector of length N and I would like to randomly allocate the
value 1 to one of the values of this vector. I presume I have to use the
uniform distribution but could someone tell me how I should process?
Thanks in advance,
Boris
--
View this message in context: http://r.789695.n4.nabble.com/generate-randomly-a-value-of-a-vector-tp3798190p3798190.html
Sent from the R
2011 Nov 17
1
Fisher Exact Test
This mean
First, I am no expert but I am analyzing some marketing data.
I have information on two versions of the same site, and I have data
on the number of times people filled out a form on each version
of the site.
Sample data:
Site 1 Site 2
Filled out form 10 35
Did not fill out form 50