[R] Linear Model with Discrete Data
Lorenzo Isella
lorenzo.isella at gmail.com
Thu Jun 13 22:49:21 CEST 2013
Dear All,
I am struggling with a linear model and an allegedly trivial data set.
The data set does not consist of categorical variables, but rather of
numerical discrete variables (essentially, they count the number of times
that something happened).
Can I still use a standard linear regression, i.e. something like lm(y~x)?
I attach a small snippet that illustrates the difficulties that I am
experiencing (I do not understand why R complains about a list()).
Any suggestion is appreciated.
The data file can be downloaded from
http://db.tt/hEKv1wH2
Cheers
Lorenzo
#####################################
data <- read.csv("testData.csv", header=TRUE)
data <- subset(data,select= -c (X100, X182))
y <- data$X358
z <- subset(data, select=-c(X358))
myLM <- lm(y~z)
#####################
More information about the R-help
mailing list