Posts tagged with regression

I found time and read Gelman and Hill’s “Data Analysis Using Regression and Multilevel / Hierarchical Models“…Now, please do yourself a favour and get it (of course the paperback version ;) ). Even for experienced or intermediate (myself) this will be a treat for your eyes and neurons.

PS : (Confession) I didn’t like the Bayesian Data Analysis book.

The nls() function has a well documented (and discussed) different behavior compared to the lm()’s. Specifically you can’t just put an indexed column from a data frame as an input or output of the model.

> nls(data[,2] ~ c + expFct(data[,4],beta), data = time.data,
+ start = start.list)
Error in parse(text = x) : unexpected end of input in "~ "

The following will work, when we assign things as vectors.

> nls(y ~ c + expFct(x,beta), data = time.data,start = start.list)
#
# Formula: y ~ c + expFct(x,beta)
#
# Parameters:
#        Estimate Std. Error t value Pr(>|t|)    
# c     3.7850419  0.0042017  900.83  < 2e-16 ***
# beta  0.0053321  0.0003733   14.28 1.31e-12 ***
# ---
# Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#
# Residual standard error: 0.01463 on 22 degrees of freedom
#
# Number of iterations to convergence: 1
# Achieved convergence tolerance: 7.415e-06

So many times you’ve in a situation where Excel is your god-sent tool. Yeap, I’m talking about statistics & excel, the 8th sin! I found myself tutoring a couple of days ago and I found myself stuck with Excel. How to perform a stepwise procedure overcoming the burden of VB (which I know nothing about it) or defining cell functions?

There is an add-in that comes handy I must admit, Stepwise Regression Add-In. There is one or two problems when installing and I had a problem with variables names (I solved it using the usual notation x1,x2,…,xn,y I suggest you do the same) but it’s overall good. When in a situation as mine , use it!

Real Time Web Analytics