Displaying 20 results from an estimated 3000 matches similar to: "Saving fits (glm, nls) without data"
2008 Jan 12
2
glm expand model to more values
Hi
I have the problem with fitting curve to data with lm and glm. When I
use polynominal dependiency, fitted values from model are OK, but I
cannot recive proper values when I use coefficents to caltulate this.
Let me present simple example:
I have simple data.frame: (dd)
a: 1 2 3 4 5 6
b: 3 5 6 7 9 10
I try to fit it to model:
model=glm(b~poly(a,3),data=dd)
I have following data
2010 Jun 08
2
Extract/format/show for S4 objects
Hi all,
I'm trying to make an integer-backed quarter (as in fraction of year)
class, but I can't quite it to work. I want integer-backed so I don't
have to worry about floating-point effects when doing math, and so that
I can use it as in data.table.
First of all, is there a good reference for this anywhere? All of the
S4 tutorials that I've found have been too high-level, and
2010 Aug 06
3
memory use without running gc()
Is there any way to get the current memory used by R without running
gc()?
I'd like to include the memory usage in logging output, but calling gc()
to get that information takes long enough to be noticeable (~ 6 s with ~
20 GB of ram in use), which goes against the point of logging.
Thanks,
Johann
2006 Jan 31
1
warnings in glm (logistic regression)
Hello R users
I ran more than 100 logistic regression analyses. Some of the analyses gave
me this kind warning below.
###########################################################
Warning messages:
1: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights,
start = start, etastart = etastart, ...
2: fitted probabilities numerically 0 or 1 occurred in: glm.fit(x = X, y =
Y,
2010 Nov 13
1
Define a glm object with user-defined coefficients (logistic regression, family="binomial")
Hi there,
I just don't find the solution on the following problem. :(
Suppose I have a dataframe with two predictor variables (x1,x2) and one
depend binary variable (y). How is it possible to define a glm object
(family="binomial") with a user defined logistic function like p(y) =
exp(a + c1*x1 + c2*x2) where c1,c2 are the coefficents which I define.
So I would like to do no
2006 Jan 29
1
extracting 'Z' value from a glm result
Hello R users
I like to extract z values for x1 and x2. I know how to extract coefficents
using model$coef
but I don't know how to extract z values for each of independent variable. I
looked around
using names(model) but I couldn't find how to extract z values.
Any help would be appreciated.
Thanks
TM
#########################################################
>summary(model)
Call:
2006 Apr 07
4
saving estimates from a for loop for later use
Thanks to the help of many on this list, I am now an R user and have
been able to write some functioning code to do matching estimation.
I have two for loops (i in 1:3, and j in 0:2). Within the loops, I
had been creating matrices of relevant estimation coefficents in order
to make lots of LaTeX tables.
Well, now I want to be able to combine the results of many different
estimations from within
2009 Dec 30
1
lm() and factors appending
How for the love of god can I prevent the lm() function from padding on to
my factor variables?
I start out with 2 tables:
Table1
123123
124351
...
626773
Table2
Count,IS_DEAD,IS_BURNING
1231,T,F
4521,F,T
...
3321,T,T
Everything looks fine when I import the data.
then we get a
oh_crap <- lm(table1 ~ Count + IS_DEAD + IS_BURNING, table2)
Magically when I look at my oh_crap coefficents
2012 Nov 27
1
best HDF5 package: h5r or rhdf5?
What is the current best package for manipulating HDF5 data files?
I tried "hdf5" a long time ago, but I ran into memory problems. "h5r" is on
CRAN now, and "rhdf5" is part of bioconductor.
Ideally, I'd like to read simple vectors or tables, either the entire thing
or a subset of rows. I don't need much writing support, but it would be
nice. Compression is a
2010 Aug 11
2
a question regarding updating formulas with coefficients
I have formulae with coefficents that I would like to update. However, I get some strange results. For example, see the following:
For the formula y ~ d+ 3*r+t I want to add a variable p, so
> update(y~d+0*r+t, .~.+p)
produces
y ~ d + t + p - 1
If the coefficient is not 0, but rather, something else - say, 3, I get the following:
> update(y~d+3*r+t, .~.+p)
Error in
2007 Jan 16
1
nonlinear regression: nls, gnls, gnm, other?
Hi all,
I'm trying to fit a nonlinear (logistic-like) regression, and I'd like
to get some recommendations for which package to use.
The expression I want to fit is something like:
y ~ A * exp(X * Beta1) / (1 + exp(-(x + X * Beta2 - xmid)/scal))
Basically, it's a logistic function, but I want to be able to modify
the saturation amplitude by a few parameters (Beta1) and shift the
2003 Aug 14
2
Using spline parameters to generate data
# I need to generate some data. I'm modeling some time series that follow
a
# negative exponential decay (mostly). I have 20 samples that can easily
be fit with cubic splines.
# What I want to do is generate many thousands of similar samples using
the parameters from the splines
# For instance one data sample looks not unlike this:
foo.curve <- 1 * exp(-0.01 * 1:500) + 0.5
2009 Nov 09
1
zoo: bug with unique for yearmon
I'm using R 2.10.0, with zoo 1.5-8. The release notes for zoo 1.5-8
claim a bug with unique for yearmon objects has been fixed, but I'm
still having problems.
Browse[1]> tmp2
[1] "Dec 1996" "Dec 1996"
Browse[1]> unique(tmp2)
[1] "Dec 1996" "Dec 1996"
Browse[1]> unique(unique(tmp2))
[1] "Dec 1996"
Browse[1]> as.numeric(tmp2) -
2010 Dec 01
3
Question regarding legend look
Hi everyone.
I have a quick question regarding the look of my legend in my plot. As you
can see in the next figure, I have 3 series.
http://r.789695.n4.nabble.com/file/n3067466/legend.png
However, I find rather difficult to differentiate the series 1 and 3
according to their line type (lty). I would like to know if it was possible
to make the line type in the legend to appear more clearly.
2004 Oct 08
1
Correlation Matrix
Hi,
I'm dealing with a datamining analysis: I've a lot of
categories of product sold per week (n. week =26, n.
categories about 50.
my dataframe is like this:
Settimana ALIMENTI..ALTRI. ALIMENTI.APROTEICI
1 1 3 19
2 2 2 0
3 3 1 22
4 4 2
2007 May 26
1
How to get the "Naive SE" of coefficients from the zelig output
Dear R-user:
After the fitting the Tobit model using zelig, if I use the following command then I can get the regression coefficents:
beta=coefficients(il6.out)
> beta
(Intercept) apache
4.7826 0.9655
How may I extract the "Naive SE" from the following output please?
> summary(il6w.out)
Call:
zelig(formula = il6.data$il6 ~ il6.data$apache, model =
2012 Dec 09
1
Some coefficients are doubled when I use the step() function
Hello-
Such a strange problem, can't figure it out at all. Using binomial glm
models, and the step() function, so the call looks like this:
sectionmodel = glm(formula = Target3 ~ S1Q12_NUM.1 + S1Q9_NUM.1 + S1Q5_NUM.1 +
S1Q7_NUM.1 + S1Q8_NUM.1 + S1Q6_NUM.1 + S1Q10_NUM.1 + S1Q12_BURG.1 +
S1Q12_CD.1 + S1Q4.1 + S1Q12_OTHVIOL.1 + S1Q8.1 + S1Q12_GBH.1 +
S1Q11.1 + S1Q7.1 + S1Q12_THEFT.1
2007 Jun 25
2
Re : Half of a heatmap
> I am trying to produce a heatmap of pairwise correlations, but since the matrix is
> symmetric, I only need either the upper or the lower triangle. I have scoured the
> web and R documentation, but I have not been able to find a way to produce such a
> figure. Is there a simple way to produce a heat map with only the part above or
> below the diagonal?
You might want to check
2005 Jan 25
29
Write-up on RoR + XUL Sample
Hi Folks,
Just a quick message saying that, after much demand, I wrote a quick
write-up for the RoR + XUL thing I did yesterday:
http://www.zedshaw.com/blog/programming/ruby_xul.html
It lays out the few simple things I did, has a bit of rant on an
unrelated topic, and other stuff but it''s short still.
On a related note, I''d like to thank "xal" on IRC for reminding
2006 Oct 18
2
Multiple histograms in one plot
Hi all,
I'm trying to plot multiple histograms in one plot (cross-validation
values of model parameters), but I cannot seem to reduce the margins
enough to fit as many of them in as I would like.
I'm using split.screen to divide the window into a 5x4 grid, then
plotting with hist. I've tried explicitly reducing the margins with
par(mar=c(1,1,1,1)), but it doesn't seem to have