Displaying 20 results from an estimated 4000 matches similar to: "Confused with Student's sleep data description"
2006 Aug 24
1
how to constrast with factorial experiment
Hello, R users,
I have two factors (treat, section) anova design experiment where
there are 3 replicates. The objective of the experiment is to test if
there is significant difference of yield between top (section 9 to 11)
and bottom (section 9 to 11) of the fruit tree under treatment. I
found that there are interaction between two factors. I wonder if I
can contrast means from levels of
2010 Aug 12
3
Median abline how-to ?
Hi,
I'm newbie with R and don't really know how to add a median line to each
of the groups that is not all the plot long.
Here is a small working code that i have adapted for my purpose. If
somebody could tell me how to draw median lines on each group and not
all plot long.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <-
2008 Jul 16
1
Output design question
Dear R-helpers,
I was curious why the output of summary (and many other functions in
R) does not add a separator between the name of a factor and the label
of a level (e.g., in the example below, 'group Trt'). If the user had
lower case labels (e.g., 'trt'), the output would be particularly hard
to read.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt
2006 Jan 16
4
Standardized beta-coefficients in regression
Hello list,
I am used to give a lot of attention to the standardized regression
coefficients, which in SPSS are listed automatically.
Is there alternative to running the last two lines in the following example to
get all the information?
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
summary( lm(ctl ~ trt) )
2005 Feb 17
2
dumping the summary of lm to a text file
Hello list,
I have a linear regression
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
reg <- lm(weight ~ group)
sreg <- summary(reg)
and I would like to dump exactly what I see on the console with
2006 Nov 09
1
Extracting the full coefficient matrix from a gls summary?
Hi,
I am trying to extract the coefficients matrix from a gls summary.
Contrary to the lm function, the command fit$coefficients returns
only the estimates of the model, not the whole matrix including the
std errors, the t and the p values.
example:
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <-
2009 Feb 28
3
Extract statistics from lm()
Hi, perhaps this question was answered previously however I could not find
them. My problem is how how to extract a particular statistic from the
result given by lm(). For e.g.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
>
2011 Jul 11
2
lm: mark sample used in estimation
Hi all,
I wanted to mark the estimation sample: mark what rows (observations)
are deleted by lm due to missingness. For eg, from the original
example in help, I have changed one of the values in trt to be NA
(missing).
# code below
# ----
# original example
> ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
> trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
#
2013 Feb 19
1
Small quirks in summary.(g)lm docs
Hi!
In R 3.0.0 from current SVN, ?summary.lm says:
> Value [...]
> df degrees of freedom, a 3-vector (p, n-p, p*), the last
> being the number of non-aliased coefficients.
?summary.glm says:
> df a 3-vector of the rank of the model and the number of residual
> degrees of freedom, plus number of non-aliased coefficients.
It seems to me that the description is reversed: p is
2007 Nov 26
1
pass lm( ) a char vector as the variables to be included
Dear Everyone in list:
I am writing some codes to automate the process of
fitting linear models where the names of variables of
models are produced and stored in character vectors.
But I have problems to pass the vectors to the lm( )
because I don't know how to strip the quotation marks
automatically.
Here are the codes of the example of lm( ):
## Annette Dobson (1990) "An Introduction
2009 Sep 03
1
Export objects
<r-help@r-project.org>
Hi, R users,
How can I export an R object as a .txt file? As an example I have the result
from a regression and I need to save this object in a .txt file
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl,
2014 May 12
2
Duda_TEST DE WALD
Buenos días,
Gracias Carlos, siguiendo el ejemplo que comentas, esto es lo que he
introducido en el Scrip de RStudio:
*library(xlsx)*
*library(xlsxjars)*
*library(rJava)*
*library(aod)*
*R<-read.csv("2002.CSV", sep=";", dec=",", header=T)*
*attach(R)*
*group<-gl(2,670,1340,labels= c("AVE", "Log.Imports.Value.in.1000.USD"))*
2012 Dec 23
1
Esttab error while exporting regression results
Dear listers,
I am trying to export a regression output to a latex document using the R
package eststo.
I have two variables:
an ordered factor:
group <- gl(3,5,20, labels=c("Ctl","Trt","prp"))
and a continuous variable:
weight <- runif(20)
I want to regress weight over group, therefore I run:
reg1 <- lm(weight ~ group)
I wish to include the output of my
2011 Dec 04
6
Problema (¿bicho?) en función lm, R 2.14.0
Hola:
Al tratar de utilizar la función lm R explota, no se si se trata de un
problema de mi máquina o me he dado de bruces con un bicho.
Después de intentar depurar mi código he probado lo más básico, abrir R
(probado en consola y Rkward) y lanzar los ejemplos de lm, esto es lo
que me encuentro:
---------- Corte desde la consola -------------------
R version 2.14.0 (2011-10-31)
Copyright (C)
2008 Oct 15
2
Network meta-analysis, varConstPower in nlme
Dear Thomas Lumley, and R-help list members,
I have read your article "Network meta-analysis for indirect treatment
comparisons" (Statist Med, 2002) with great interest. I found it very
helpful that you included the R code to replicate your analysis;
however, I have had a problem replicating your example and wondered if
you are able to give me a hint. When I use the code from the
2007 Mar 14
1
How to transform matrices to ANOVA input datasets?
Hello, R experts,
I have a list called dataHP which has 30 elements (m1, m2, ..., m30).
Each element is a 7x6 matrix holding yield data from two factors
experimental design, with treatment in column, position in row. For
instance, the element 20 is:
dataHP[[20]]
col1 col2 col3 trt1 trt2 trt3
[1,] 22.0 20.3 29.7 63.3 78.5 76.4
[2,]
2008 Jun 04
1
"& not meaningful for factors"
I am trying to define groupings from levels of factor variables and this the warning message that R give
"& not meaningful for factors".
The nature of my task is this. I have a variable stage which has the levels (1B, 2A, 2B) - these are the AJCC TNM stages of cancer, and another variable diameter with factor levels ("=< 4", "4 - 6.5, > 6.5; limit values are
2010 Dec 01
2
Lattice dotplots
Dear,
I have a dataset with 4 subjects (see ID in example), and 4 treatment (see
TRT in example) which are tested on 2 locations and in 3 blocs. By using
Lattice dotplot, I made a graph that shows the raw data per location and
per bloc. In that graph, I would like to have a reference line per bloc
that refers to the first treatment (T1). However, I can not find how to do
that.
I can make
2011 Apr 20
2
survexp with weights
Hello,
I probably have a syntax error in trying to generate an expected
survival curve from a weighted cox model, but I can't see it. I used
the help sample code to generate a weighted model, with the addition
of a "weights=albumin" argument (I only chose albumin because it had
no missing values, not because of any real relevance). Below are my
code with the resulting error
2008 Mar 05
1
Question on "assign(paste.."
Hello,
I'm having trouble in using "assign(paste ..." command . I could create
several dataframes following trinomial distribution using it but it could
not be used to check their row means of the created dataframe.
For example, the following works:
probTrt=matrix(0,4,3);
probTrt;
#malf, death, normal
probTrt[1,]=c(0.064,0.119,0.817);#for Trt 1
probTrt[2,]=c(0.053,0.125,0.823);#for