Re: [R] longitudinal survey data

2005-05-27 Thread h . brunschwig

Thank you for your reply.

Does that mean that in order to take in account the repeated measures I denote
these as another cluster in R?

Dassy


Quoting Thomas Lumley [EMAIL PROTECTED]:

 On Thu, 26 May 2005 [EMAIL PROTECTED] wrote:
 
 
  Dear R-Users!
 
  Is there a possibility in R to do analyze longitudinal survey data
 (repeated
  measures in a survey)? I know that for longitudinal data I can use lme()
 to
  incorporate the correlation structure within individual and I know that
 there is
  the package survey for analyzing survey data. How can I combine both? I
 am
  trying to calculate design-based estimates. However, if I use svyglm() from
 the
  survey package I would ignore the correlation structure of the repeated
 measures.
 
 
 You *can* fit regression models to these data with svyglm(). Remember that 
 from a design-based point of view there is no such thing as a correlation 
 structure of repeated measures -- only the sampling is random, not the 
 population data.
 
 
 If you *want* to fit mixed models (eg because you are interested in 
 estimating variance components, or perhaps to gain efficiency) then it's 
 quite a bit trickier. You can't just use the sampling weights in lme(). 
 You can correct for the biased sampling if you put the variables that 
 affect the weights in as predictors in the model.  Cluster sampling could 
 perhaps then be modelled as another level of random effect.
 
 
   -thomas
 
 Thomas Lumley Assoc. Professor, Biostatistics
 [EMAIL PROTECTED] University of Washington, Seattle


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] longitudinal survey data

2005-05-27 Thread h . brunschwig
Sorry, still confused. If I dont have fpc's ready in my dataset (calculate
myself?) that means that R will use the weight of an individual for each of his
repeated observations. But is that then still correct? The cluster individual
is ignored and each observation of an individual has the same weight.

Thanks a lot.

Dassy

Quoting Thomas Lumley [EMAIL PROTECTED]:

 On Fri, 27 May 2005 [EMAIL PROTECTED] wrote:
 
 
  Thank you for your reply.
 
  Does that mean that in order to take in account the repeated measures I
 denote
  these as another cluster in R?
 
 
 Yes, but unless you have multistage finite population corrections to put 
 in the design object only the first stage of clustering affects the 
 results, so you may not need to bother.
 
   -thomas
 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] MLE: Question

2005-02-07 Thread h . brunschwig

Hi R users! 

I have a likelihood ratio statistic that depends on a parameter delta and I am
trying to get confidence intervals for this delta using the fact that the
likelihood ratio statistic is approx. chi-squared distributed.

For this I need to maximize the two likelihoods (for the ratio statistic) one of
which depends on delta too and I am trying to use the function mle. But delta
is neither a parameter I would like to estimate nor a fixed value that I know
the value of (to give it to the mle function with fixed=list(delta=?)). 

Can I still use mle to find the likelihood of the data (just denoting delta as
a constant)?

Thank you.

Hadassa

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] survreg: fitting different location parameters

2005-01-24 Thread h . brunschwig
Hi R-Help!

My question: I have lifetime/failure data of machines with different
stress levels and i think an weibull/extreme value distribution would
fit this data. So I did:

model1  - survreg(Surv(lfailure)~stress,data=steel,dist=extreme)

(where lfailure=log(failure))

Now I would like to do a likelihood ratio test to test the hypothesis

H0: location parameters of the extreme value distribution are equal
for each stress level.

So in order to perform the likelihood ratio test I need the likelood
of the model under

HA: location parameters are not equal (i.e. each stress level has its
slope and intercept).

How can I do this?

Thanks for any help!

Hadassa

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] survreg: fitting different location parameters

2005-01-24 Thread h . brunschwig
Hi R-Help! 

My question: I have lifetime/failure data of machines with different 
stress levels and i think an weibull/extreme value distribution would 
fit this data. So I did: 

model1  - survreg(Surv(lfailure)~stress,data=steel,dist=extreme) 

(where lfailure=log(failure)) 

Now I would like to do a likelihood ratio test to test the hypothesis 

H0: location parameters of the extreme value distribution are equal 
for each stress level. 

So in order to perform the likelihood ratio test I need the likelood 
of the model under 

HA: location parameters are not equal (i.e. each stress level has its 
slope and intercept). 

How can I do this? 

Thanks for any help! 

Hadassa

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] survreg: fitting different location parameters

2005-01-24 Thread h . brunschwig
I am still trying to find a common intercept but a different slopes for each 
group within my lifetime data. By stratifying the variable stress (the groups) 
I get different scale parameters which is not my goal.
So I did this:

survreg(Surv(lfailure)~as.factor(stress),data=steel,dist=extreme)

and I did get different slopes but common intercepts and scales.
Is this correct? I am a bit unsure as I did it with a different software and 
got different estimates...

Thanks for any help

Hadassa





Quoting Göran Broström [EMAIL PROTECTED]:

 On Sun, Jan 23, 2005 at 03:10:18PM -0500, [EMAIL PROTECTED] wrote:
  Hi R-Help! 
  
  My question: I have lifetime/failure data of machines with different 
  stress levels and i think an weibull/extreme value distribution would 
  fit this data. So I did: 
  
  model1  - survreg(Surv(lfailure)~stress,data=steel,dist=extreme) 
  
  (where lfailure=log(failure)) 
  
  Now I would like to do a likelihood ratio test to test the hypothesis 
  
  H0: location parameters of the extreme value distribution are equal 
  for each stress level. 
  
  So in order to perform the likelihood ratio test I need the likelood 
  of the model under 
  
  HA: location parameters are not equal (i.e. each stress level has its 
  slope and intercept). 
  
  How can I do this? 
 
 Stratify on stress level. 
 -- 
  Göran Broströmtel: +46 90 786 5223
  Department of Statistics  fax: +46 90 786 6614
  Umeå University   http://www.stat.umu.se/egna/gb/
  SE-90187 Umeå, Sweden e-mail: [EMAIL PROTECTED]


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] lme: Variances

2005-01-01 Thread h . brunschwig

Hi R users!

I will try to state my question again. I have longitudinal data and fitted the
following model with lme:

Y = X*beta + U + W(t) + Z

where 

U ~ N(0, nu*I)   I is the identity matrix, so this is the random intercept

W(t)~ N(0, sigma*H)  and H is a matrix which incorporates a Gaussian serial
 
 correlation (covariance) in the offdiagonal elements

Z ~ N(0, tau*J)  the (measurement) error

So lme must have estimated three variance parameters plus the parameter for the
Gaussian correlations. From the output I get, I dont know which is which. The
output was:

 nepal.lme-lme(ht~sex+died+alive+mage+lit+bf+age+I(age^2),
data=nepal,random=~1|id,correlation=corGaus(corstruct,form=~age|id)
,na.action=na.exclude)

 summary(nepal.lme)
Linear mixed-effects model fit by REML
 Data: nepal 
   AICBIClogLik
  3363.547 3420.7 -1669.774

Random effects:
 Formula: ~1 | id
(Intercept) Residual
StdDev:4.240752 1.240242

Correlation Structure: Gaussian spatial correlation
 Formula: ~age | id 
 Parameter estimate(s):
   range 
4.662006 
Fixed effects: ht ~ sex + died + alive + mage + lit + bf + age + I(age^2) 
   Value Std.Error  DF   t-value p-value
(Intercept) 51.07075 2.0274503 674  25.18964  0.
sex -0.54780 0.6210172 191  -0.88210  0.3788
died-0.01686 0.3915936 191  -0.04306  0.9657
alive   -0.46979 0.2388267 191  -1.96706  0.0506
mage 0.34289 0.0859849 191   3.98785  0.0001
lit  2.62584 1.5123958 191   1.73621  0.0841
bf   0.31873 0.0870432 674   3.66173  0.0003
age  0.86269 0.0198487 674  43.46318  0.
I(age^2)-0.00334 0.0002347 674 -14.24842  0.
 Correlation: 
 (Intr) sexdied   alive  mage   litbf age   
sex  -0.419 
died -0.063 -0.095  
alive 0.475  0.041 -0.484   
mage -0.814 -0.035  0.188 -0.780
lit  -0.072 -0.099  0.092  0.003  0.059 
bf   -0.098  0.000  0.002 -0.001  0.008  0.008  
age  -0.168  0.016  0.003 -0.008 -0.018 -0.008  0.250   
I(age^2)  0.146 -0.010 -0.010  0.009 -0.007  0.005 -0.156 -0.917

Standardized Within-Group Residuals:
Min  Q1 Med  Q3 Max 
-4.22819684 -0.45649041 -0.02996715  0.43379089  2.70363057

Thanks for any help.

Hadassa

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] lme: Confusion about Variances

2004-12-31 Thread h . brunschwig

Dear R users!

I used lme to fit a mixed model with random intercept and spatial Gaussian
correlation i.e. I fitted a model of the following form:

Y = X*beta + error

and

error = U + W(t) + Z

where U is the random intercept (normally distributed), W(t) the stationary
Gaussian process and Z also a normally distributed (the residual) rv. Each of
these three random variables have a variance which I am not sure to which output
in lme they belong to.
VarCorr gives the intercept and residual variance which I assume belong to U and
Z respectively. The output of lme gives another estimate called range which I
assume belongs to the parameter estimate needed for the Gaussian correlation.

Are my assumptions correct? And where can I get the variance for the W(t) from?

Thanks for any answers...and happy new year...

Hadassa

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html