Displaying 20 results from an estimated 2000 matches similar to: "How to improve, at all, a simple GLM code"
2012 Apr 01
1
Possibly more coefficients?
Hi there,
I have this code:
Prepared_Data <- na.omit(read.csv("Prepared_Data.csv", header=TRUE))
pd <- Prepared_Data[,-3] ## data minus response variable
lev <- sapply(pd,function(x) length(unique(x)))
## total parameters for n variables
par(las=1,bty="l")
plot(cumprod(lev),log="y")
library(Matrix)
m <- sparse.model.matrix(~.^2,data=pd)
ncol(m)
2012 Apr 29
1
CForest Error Logical Subscript Too Long
Hi,
This is my code (my data is attached):
library(languageR)
library(rms)
library(party)
OLDDATA <- read.csv("/Users/Abigail/Documents/OldData250412.csv")
OLDDATA$YD <- factor(OLDDATA$YD, label=c("Yes", "No"))?
OLDDATA$ND <- factor(OLDDATA$ND, label=c("Yes", "No"))?
attach(OLDDATA)
defaults <- cbind(YD, ND)
set.seed(47)
data.controls
2012 Mar 29
1
Data handling/optimum glm method.
Hi there,
I am trying to fit a generalised linear model to some loan application and default data. The purpose of this is to eventually work out the probability an applicant will default.
However, R seems to crash or die when I run "glm" on anything greater than a 5-way saturated model for my data.
My first question: is the best way to fit a generalised linear model in R to fit the
2013 Sep 13
1
Creating dummy vars with contrasts - why does the returned identity matrix contain all levels (and not n-1 levels) ?
Hello,
I have a problem with creating an identity matrix for glmnet by using the
contrasts function.
I have a factor with 4 levels.
When I create dummy variables I think there should be n-1 variables (in this
case 3) - so that the contrasts would be against the baseline level.
This is also what is written in the help file for 'contrasts'.
The problem is that the function
2012 Mar 21
2
glmnet: obtain predictions using predict and also by extracting coefficients
All,
For my understanding, I wanted to see if I can get glmnet predictions
using both the predict function and also by multiplying coefficients
by the variable matrix. This is not worked out. Could anyone suggest
where I am going wrong?
I understand that I may not have the mean/intercept correct, but the
scaling is also off, which suggests a bigger mistake.
Thanks for your help.
Juliet Hannah
2011 Feb 03
1
glmnet with binary predictors
Hi Everybody!
I must start with a declaration that I am a sparse user of R. I am
creating a credit scorecard using a dataset which has a variable
depicting actual credit history (good/bad) and 41 other variables of
yes/no type. The procedure I am asked to follow is to use a penalized
logistic procedure for variable selection. I have located the package
"glmnet" which gives the complete
2011 Aug 04
1
Can glmnet handle models with numeric and categorical data?
Dear All,
Can the x matrix in the glmnet() function of glmnet package be a
data.frame with numeric columns and factor columns? I am asking this
because I have a model with both numeric and categorical predictors,
which I would like to study with glmnet. I have already tried to use a
data.frame, but with no success -- as far as I know, the matrix object
can only have data of a single type. Is
2011 Oct 25
1
Glmnet Logistic Variable Questions
We are workin on building a logistic regression using
1. We are doing a logistic regression with binary outcome variable
using a set of predictors that include 8 continuous and 8 category
predictors
2. We are trying to implement interaction between two variables
(continuous and category or just continuous)
The dataset is 200,000 rows and we are using glmnet, how can we model
those two points ?
2006 Feb 21
2
validates_format_of :url, regexp?
Hey,
Does anybody have a regexp for validating URLs? I found this one and am
trying to adapt it:
^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\''\\\+&%\$#\=~_\-]+))*$
(http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21245168.html)
I also found this one, but, um,
2009 Jun 08
3
caret package
Hi all
I am using the caret package and having difficulty in obtaining the results
using regression, I used the glmnet to model and trying to get the
coefficients and the model parameters I am trying to use the
extractPrediction to obtain a confusion matrix and it seems to be giving me
errors.
x<-read.csv("x.csv", header=TRUE);
y<-read.csv("y.csv", header=TRUE);
2010 Feb 11
2
Compile/Build Speex on iPhone
Hello,
I am completely new to Speex and make files but I'm looking to build/
run Speex on the iPhone for decoding and potentially encoding. I've
read that you can just copy the source into an XCode project which I
tried but I started getting all kinds of compile errors. (1000+) There
were things like missing references to ogg header files and so forth.
Could someone explain
2011 Feb 01
2
Preparing dataset for glmnet: factors to dummies
Hello list.
For some reason, the makers of glmnet do not accept a dataframe as input.
They expect the input to be a matrix, where the dummies are already
precoded.
Now I have created a sample dataset with
. 11 factor columns with two levels
. 4 factor columns with three levels
. 135 continuous columns (from a standard normal)
. 100 observations (rows)
Say this dataframe is in dfrPredictors.
What
2010 Apr 29
4
Simple example of decoding streaming audio realtime?
Hi,
I'm new to Speex and a little uncomfortable in C programming. I'm looking for a simple example of how I'd use Speex to decode a speex file read off of an network stream and pass the decoded samples to an audio player. I have speex running in an iPhone project and I started digging thru the speexdec.c example trying to refactor as I made sense of the API calls. The example is a
2009 Jul 28
2
Check functions in package
Hi, I run R on a server via SSH, over a terminal. After loading a specific
package, how do I know what functions are in that package? Is there any way
to list or display them?
tia.
--
View this message in context: http://www.nabble.com/Check-functions-in-package-tp24707084p24707084.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
2013 Jul 06
1
problem with BootCV for coxph in pec after feature selection with glmnet (lasso)
Hi,
I am attempting to evaluate the prediction error of a coxph model that was
built after feature selection with glmnet.
In the preprocessing stage I used na.omit (dataset) to remove NAs.
I reconstructed all my factor variables into binary variables with dummies
(using model.matrix)
I then used glmnet lasso to fit a cox model and select the best performing
features.
Then I fit a coxph model
2011 Jun 23
1
gcc-4.5.2 and install.packages("glmnet")?
Hi,
is there any chance to install glmnet with gcc-4.5.2? For me it fails on
all systems with:
trying URL
'http://mirrors.softliste.de/cran/src/contrib/glmnet_1.7.tar.gz'
Content type 'application/x-gzip' length 522888 bytes (510 Kb)
opened URL
==================================================
downloaded 510 Kb
* installing *source* package ?glmnet? ...
This package has only
2013 Dec 07
1
combine glmnet and coxph (and survfit) with strata()
Dear All,
I want to generate survival curve with cox model but I want to estimate the
coefficients using glmnet. However, I also want to include a strata() term
in the model. Could anyone please tell me how to have this strata() effect
in the model in glmnet? I tried converting a formula with strata() to a
design matrix and feeding to glmnet, but glmnet just treats the strata()
term with one
2011 Jul 25
6
puppetmaster SSL_Read
Seeing ''SSL_read'' errors being logged by puppetmaster. Anyone know
what causes these or how to correct? They''re sporadic, not happening
all the time or on all puppet runs.
/var/log/puppet/masterhttp.log
[2011-07-25 10:00:10] ERROR OpenSSL::SSL::SSLError: SSL_read::
internal error
/var/log/messages
Jul 25 10:00:10 cmd-box puppet-master[22572]: SSL_read:: internal
error
2010 Feb 11
1
Compile/Build Speex on iPhone
The off dependencies are only for speexenc and speexdec, as far as I
recall.
If you omit those targets, you shouldn't have the ogg dependency issues.
On Feb 10, 2010, at 22:21, Jean-Marc Valin <jean-marc.valin at usherbrooke.ca
> wrote:
> Unless you want to work on files (rather than RTP), you don't need any
> of the stuff that uses ogg.h
>
> Jean-Marc
>
>