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]]
Perdón, quise escirbir Dummy, en lugar de Gummy. Saludos --- El jue, 20/9/12, Eva Prieto Castro <evapcastro@yahoo.es> escribió: De: Eva Prieto Castro <evapcastro@yahoo.es> Asunto: Gummy Variables - Test Paramétrico Para: r-help-es@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]]
Eva Prieto Castro
2012-Sep-20 10:42 UTC
[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@yahoo.es> escribió: De: Eva Prieto Castro <evapcastro@yahoo.es> Asunto: Dummy Variables - Test Paramétrico Para: r-help-es@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@yahoo.es> escribió: De: Eva Prieto Castro <evapcastro@yahoo.es> Asunto: Gummy Variables - Test Paramétrico Para: r-help-es@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]]
Marcuzzi, Javier Rubén
2012-Sep-20 10:55 UTC
[R-es] Resuelto!! Dummy Variables - Test Paramétrico
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