Dear R-Help, 

 

I'm new to R and struggling with weighting data when I run regression. I've
tried to use search to solve my problem but haven't found anything helpful
so far.

 

I (successfully) import data from SPSS (15) and try to run a linear
regression on a subset of my data file where WEIGHT is the name of my
weighting variable (numeric), e.g.:

 

library(foreign)

data1=read.spss("File.sav", use.value.labels = FALSE, to.data.frame = TRUE)

summary(data1) ' shows me all the variables OK

attach(data1)

linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights==WEIGHT)

 

and I get the following Error message:

 

Error in weights == WEIGHT : 

  comparison (1) is possible only for atomic and list types

 

It works perfectly if I don't use the ", weights==WEIGHT" bit

 

 

Could you please let me know what I am doing wrong? 

 

Thank you in advance, 

Lena

 

 

 

 


	[[alternative HTML version deleted]]

