check code for Type III in R [🇷 for BE/BA]
Hi ElMaestro,
First of all, Thank you for your quick reply and sorry for late my reply.
I run drop1() you recommended. the results are below.
the results are same with SAS result except for SEQ and residuals.
if i want to get the SS of SEQ and residuals, should i use other function? or can get from drop1()?
You mentioned below. but I'm sorry I did not exactly understand about sequence.
Could you explain that more in detail?
Best Regards
WHM
❝ ❝ I've tried drop1() mentioned prior posts but it did now show all SAS showed.
First of all, Thank you for your quick reply and sorry for late my reply.
I run drop1() you recommended. the results are below.
----R code--------------------------------------------
>lm.test1<-lm(log(Cmax)~TRT+PRD+SEQ+SID:SEQ, data=df)
>drop1(lm.test1, ~., test=c('F'))
----R result-------------------------------------------
Single term deletions
Model:
log(Cmax) ~ TRT + PRD + SEQ + SID:SEQ
Df Sum of Sq RSS AIC F value Pr(>F)
<none> 3.8928 -207.70
TRT 1 0.1181 4.0109 -206.83 1.3950 0.2436
PRD 1 0.0765 3.9693 -207.83 0.9039 0.3467
SEQ 0 0.0000 3.8928 -207.70
SEQ:SID 46 16.4697 20.3625 -140.86 4.2308 1.458e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
--------------------------------------------------------
the results are same with SAS result except for SEQ and residuals.
if i want to get the SS of SEQ and residuals, should i use other function? or can get from drop1()?
You mentioned below. but I'm sorry I did not exactly understand about sequence.
Could you explain that more in detail?
❝ By that definition sequence will not have any appreciable SS (apart from the numerical precision) and precisely that is what you will find in R with drop1. Think about it this way: Sequence is a between-subject factor; you cannot force in an extra column for Sequence RT or TR in the design matrix since any such column can be constructed from the Subject columns and the intercepts with a little addition and subtraction.
Best Regards
WHM
Complete thread:
- check code for Type III in R WHM 2015-02-16 07:54
- check code for Type III in R ElMaestro 2015-02-16 12:17
- check code for Type III in RWHM 2015-02-24 01:56
- check code for Type III in R ElMaestro 2015-02-24 09:59
- check code for Type III in RWHM 2015-02-24 01:56
- check code for Type III in R ElMaestro 2015-02-16 12:17