Displaying 20 results from an estimated 5000 matches similar to: "Why can''t I change value of the primary key?"
2008 Nov 17
1
Type III ANOVA of package car depends on factor level order
## Question1: How to define IV with interaction alone, without main effects?
## Question2: Should Type III ANOVA in package car be independent of
the factor level order?
## data from http://www.otago.ac.nz/sas/stat/chap30/sect52.htm
drug <- c(t(t(rep(1,3)))%*%t(1:4));
disease <- c(t(t(1:3)) %*% t(rep(1,4)));
y <- t(matrix(c(
42 ,44 ,36 ,13 ,19 ,22
,33 ,NA ,26 ,NA ,33 ,21
,31 ,-3 ,NA
2018 May 04
2
Regression model fitting
Hi all ,
I have a dataframe (Hypertension) with following headers :-
> Hypertension
ID Hypertension(before drug A) Hypertension(On drug A) On drug B? Healthy diet?
1 160 90 True True
2 190
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All,
I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order.
My data have a variable called "RowNo" that functions almost like a
2018 Mar 05
2
data analysis for partial two-by-two factorial design
Hi Bert,
I am very sorry to bother you again.
For the following question, as you suggested, I posted it in both Biostars website and stackexchange website, so far no reply.
I really hope that you can do me a great favor to share your points about how to explain the coefficients for drug A and drug B if run anova model (response variable = drug A + drug B). is it different from running three
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 8:52 AM, Ding, Yuan Chun <ycding at coh.org> wrote:
>
> Hi Bert,
>
> I am very sorry to bother you again.
>
> For the following question, as you suggested, I posted it in both Biostars website and stackexchange website, so far no reply.
>
> I really hope that you can do me a great favor to share your points about how to explain the
2018 Mar 05
0
data analysis for partial two-by-two factorial design
Hi Bert and David,
Thank you so much for willingness to spend some time on my problem!!! I have some statistical knowledge (going to get a master in applied statisitics), but do not have a chance to purse a phD for statistics, so I am always be careful before starting to do analysis and hope to gather supportive information from real statisticians.
Sorry that I did not tell more info about
2007 Jul 05
3
summarizing dataframe at variable/factor levels
All,
Is there an efficient way to apply say "mean" or "median" to a dataframe
according to say all combinations of two variables in the dataframe?
Below is a simple example and the outline of a "manual" solution that
will work but is not very efficient
(could also generalize this to a function). Searched the archives and
docs but didn't see anything close to
2006 May 30
1
max / pmax
Hello R users,
I am relatively new to R and cannot seem to crack a coding problem. I
am working with substance abuse data, and I have a variable called
"primary.drug" which is considered the drug of choice for each
subject. I have just a few missing values on that variable. Instead
of using a multiple imputation method like chained equations, I would
prefer to derive these
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 2:27 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> David:
>
> I believe your response on SO is incorrect. This is a standard OFAT (one factor at a time) design, so that assuming additivity (no interactions), the effects of drugA and drugB can be determined via the model you rejected:
>> three groups, no drugA/no drugB, yes drugA/no drugB,
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 3:04 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> But of course the whole point of additivity is to decompose the combined effect as the sum of individual effects.
Agreed. Furthermore your encoding of the treatment assignments has the advantage that the default treatment contrast for A+B will have a statistical estimate associated with it. That was a
2006 Jul 07
4
How to change the type of segments ends?
Hi,
I am trying to plot odds ratios and the corresponding confidence
intervals in horizontal segments. It would be ideal if the confidence
interval segment can be drawn with little vertical bars at both ends. I
have tried very hard to change the type of ends by using 'lend'
arguments, but cannot make it. I even tried 'arrows()', but still
failed. Following is the code I use:
2018 Mar 05
2
data analysis for partial two-by-two factorial design
But of course the whole point of additivity is to decompose the combined
effect as the sum of individual effects.
"Mislead" is a subjective judgment, so no comment. The explanation I
provided is standard. I used it for decades when I taught in industry.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into
2012 Mar 30
3
Adding text for written comments to bottom of graphs
Hello All,
Recently developed the code below for graphing patterns of chemotherapy administration. As someone just starting to use R in their work, I managed to figure out some parts of the code but needed help with others.
setwd("N:/Regimen Coding/0906/Plots Test")
getwd()
TestData <- structure(list(profile_key = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3), line = c(1, 1,
2012 Mar 22
4
Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!
Hello All,
Want very much to learn how to plot patient drug timelines. Trouble is I need to figure out how to do this today. So not much time for me to struggle with it. Hoping someone can just help me out a bit.
Below are some sample data and code that produces what I think is the beginning of a very nice graph.
Need to alter the code to:
1. Get the lines for the drugs to appear on the
2006 Oct 05
2
treatment effect at specific time point within mixedeffects model
Hi David:
In looking at your original post it is a bit difficult to ascertain
exactly what your null hypothesis was. That is, you want to assess
whether there is a treatment effect at time 3, but compared to what. I
think your second post clears this up. You should refer to pages 224-
225 of Pinhiero and Bates for your answer. This shows how to specify
contrasts.
> -----Original Message-----
2018 Mar 02
3
data analysis for partial two-by-two factorial design
Dear R users,
I need to analyze data generated from a partial two-by-two factorial design: two levels for drug A (yes, no), two levels for drug B (yes, no); however, data points are available only for three groups, no drugA/no drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourth group of no drugA/yes drugB. I think we can not investigate interaction between drug A and drug B,
2018 Mar 02
0
data analysis for partial two-by-two factorial design
This list provides help on R programming (see the posting guide linked
below for details on what is/is not considered on topic), and generally
avoids discussion of purely statistical issues, which is what your query
appears to be. The simple answer is yes, you can fit the model as
described, but you clearly need the off topic discussion as to what it
does or does not mean. For that, you might try
2009 May 10
2
plot(survfit(fitCox)) graph shows one line - should show two
R 2.8.1
Windows XP
I am trying to plot the results of a coxph using plot(survfit()). The plot should, I believe, show two lines one for survival in each of two treatment (Drug) groups, however my plot shows only one line. What am I doing wrong?
My code is reproduced below, my figure is attached to this EMail message.
John
> #Create simple survival object
>
2002 Apr 18
1
Help with lme basics
In Baron and Li's "Notes on the use of R for psychology experiments and questionnaires" http://cran.r-project.org/doc/contrib/rpsych.htm they describe a balanced data set for a drug experiment:
"... a test of drug treatment effect by one between-subject factor: group (two groups of 8 subjects each) and two within-subject factors: drug (2 levels) and dose (3 levels). "
2008 Feb 05
1
Extracting level-1 variance from lmer()
All,
How does one extract the level-1 variance from a model fit via lmer()?
In the code below the level-2 variance component may be obtained via
subscripting, but what about the level-1 variance, viz., the 3.215072 term?
(actually this term squared) Didn't see anything in the archives on this.
Cheers,
David
> fm <- lmer( dv ~ time.num*drug + (1 | Patient.new), data=dat.new )