[R-es] Resuelto!! Dummy Variables - Test Paramétrico

Marcuzzi, Javier Rubén javier.ruben.marcuzzi en gmail.com
Jue Sep 20 12:55:32 CEST 2012


Estimada Eva

Es bueno saber que pudo resolver su problema con R, pero en su correo hay un 
inconveniente con las letras acentuadas  y algunas de su modelo, por lo 
menos para mi, seguramente es una codificación del sistema operativo y 
programa de correos.

Javier

-----Mensaje original----- 
From: Eva Prieto Castro
Sent: Thursday, September 20, 2012 7:42 AM
To: r-help-es en r-project.org
Subject: [R-es] Resuelto!! Dummy Variables - Test Paramétrico

Hola,

Ya resolví; descubrí cómo va lo de las dummy en el lm!!. Es muy fácil. 
Luego con más calma os lo detallaré.

Un saludo.
Eva

--- El jue, 20/9/12, Eva Prieto Castro <evapcastro en yahoo.es> escribió:

De: Eva Prieto Castro <evapcastro en yahoo.es>
Asunto: Dummy Variables - Test Paramétrico
Para: r-help-es en r-project.org
Fecha: jueves, 20 de septiembre, 2012 11:28

Perdón, quise escirbir Dummy, en lugar de Gummy.

Saludos

--- El jue, 20/9/12, Eva Prieto Castro <evapcastro en yahoo.es> escribió:

De: Eva Prieto Castro <evapcastro en yahoo.es>
Asunto: Gummy Variables - Test Paramétrico
Para: r-help-es en r-project.org
Fecha: jueves, 20 de septiembre, 2012 11:16

Hola,
Perdonadme por no traducir al español mi duda. La he dejado también en la 
lista de habla inglesa y de ahí esta "reutilización", aunque no sea de 
código...



Â

I have a system in which I analyze 2 subjects and 1 variable, so I have
2 models as follow:

Â

y ~ x_1[, 1] + x_2[, 1] + x_1[, 2] + x_2[, 2]

Â

Where

Â

x_1[, i] = cos(2 * pi * t / T_i)

x_2[, i] = sin(2 * pi * t / T_i)

Â

i = 1, 2

Â

Data have two columns: t and y.

Â

As you can see, I have a multiple components model, with rithm and
without trends, and I have a fundamental period (T_1 = 24 hour; T_2 = 12 
hour).

Â

I have to compare the parameters between the two models (one for each
subject), using a parametric test as described in the doc I adjunt (page 
500,
Parametric solution):

Â

I have to reach results as follow:

Â

______________________________________________________

H0: Equality of...          df                   
   F                p

______________________________________________________

MESORÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  ( 1, 171)Â Â Â  224.0246 Â Â 
 <0.0001

(A,phi) 24h                  ( 2, 171)        
7.6332Â Â  Â Â Â 0.0007

(A,phi) 24h                  ( 2, 171)        
5.8370Â  Â Â Â Â 0.0035

Rhythmic
components       ( 4, 171)    Â
  6.3568    <0.0001

Whole model                  (
5, 171)Â Â Â Â  Â 51.6583Â
  <0.0001




I know how to obtain df values and I know how to obtain F and p for the
whole model, because whole model means that all parameters of the two series
are equal, so it means that all values are in the same serie, so I construct 
a
unique serie concatenating the respective t’s and y’s vectors.

Â

The problem is that I don’t know how to obtain F in the other cases (H1:
equal mesor, H2.x: equal amplitude and acrophase, H3: equal rhythmic
components). I suppose I have to use dummy variables, but I don’t know how 
to
do it.

Â

I could access something similar in a solution manual of  a Weisberg
book (1985), chapter 6, problem 9, as follows:
m1 <- lm(Yvar~ Xvar + Fvar + Fvar:Xvar, na.action=na.omit, 
weights=theWeights)Â  # this is model 1 the most general

m2 <- lm(Yvar~ Xvar + Fvar            , na.action=na.omit, 
weights=theWeights)Â  # this is model 2 parallel
m3 <- lm(Yvar~ Xvar + Fvar:Xvar       ,
na.action=na.omit, weights=theWeights)Â  # this is model 3 common intercept
m4 <- lm(Yvar~ Xvar                   ,
na.action=na.omit, weights=theWeights)Â  # this is model 4 the least
general (all the same)


Â

Please could you help me?.

Â

Thank you in advance.
Eva


Â
[[alternative HTML version deleted]]







_______________________________________________
R-help-es mailing list
R-help-es en r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es



Más información sobre la lista de distribución R-help-es