Actually, I tried doing
data2 = unique(data)
mod = lm(y ~ x1 + ... + xn, data2)
fitted(mod)
and I still get les fitted values than observations.
Federico
On 4 Aug 2009, at 12:18, Federico Calboli wrote:
> Hi All,
>
> I have some data where the dependent variable is a score, low (1:3) or
> high (8:9), and the independent variables are 21 genotypic markers.
> I'm fitting a logistic regression on the whole dataset after
> transforming the score to 0/1 and normal linear regression on the high
> and low subsets.
>
> I all cases I have a numer of cases of data 'duplications', i.e.
> different individuals with the same score and the same genotype at the
> 21 markers.
>
> When I do:
>
> mod$fitted.values I get a number of fitted values corresponding to the
> umber of unique lines in the dataset. Is there a way to have the
> fitted values match the observation, even though some are duplicated
> and so have the same fitted value? I could do it by hand but it's
> laborious and I'd venture there is a better way.
>
> Best,
>
> Federico
>
>
> --
> Federico C. F. Calboli
> Department of Epidemiology and Public Health
> Imperial College, St. Mary's Campus
> Norfolk Place, London W2 1PG
>
> Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
>
> f.calboli [.a.t] imperial.ac.uk
> f.calboli [.a.t] gmail.com
>
>
>
>
>
--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com