similar to: Comparing two lines - Ancova: lm or aov?

Displaying 20 results from an estimated 130 matches similar to: "Comparing two lines - Ancova: lm or aov?"

2009 Feb 16
1
Overdispersion with binomial distribution
I am attempting to run a glm with a binomial model to analyze proportion data. I have been following Crawley's book closely and am wondering if there is an accepted standard for how much is too much overdispersion? (e.g. change in AIC has an accepted standard of 2). In the example, he fits several models, binomial and quasibinomial and then accepts the quasibinomial. The output for residual
2008 Dec 10
2
how to merge panel data stored by variable?
Hi, I have two datasets stored in tab-separated format in the following way file1: country year1 year2 Germany var1 var1 Hungary var1 var1 file2: country year1 year2 Germany var2 var2 Hungary var2 var2 I can easily read in these files, but how can I merge them as a panel dataset? Thanks, Viktor
2010 Aug 24
2
chisq.test on samples of different lengths
Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes no year 2: no yes no yes I wanted to do a chisq.test, but if I enter it this way: chisq.test(year1, year2) I get the error saying the columns are two different lengths. So then I tried
2003 Nov 17
1
Generalized linear model
Hi all! I am fitting a Poisson model, using the following command: > fit2<-glm(canc~id1+year1+time+lnpa,family=poisson) where 'id1', 'year1' and 'time' are factors. I defined them with: > id1<-C(factor(id1), treatment) and 'lnpa' is a continuous variable. The 'summary' function gives me all the effects estimates, that is, for id1, I
2007 Jun 29
1
Assign name to a name
I would like to know how I can assign a name to a name. I have a dataset that has different years in it. I am writing scripts using R and I would like to give a month a generic name and then use the generic name to do different analysis. The reason for the generic name would be so that I only have to change one thing if I wanted to change the year. For example. Year1 = 1999 datayear <-
2011 Dec 01
0
Error message: object 'A' not found
I ran the following code: And I run into problems with the last line of code (when it says hn<-......). I keep getting an error code: Error in distsamp(~hab ~ 1, peldist, keyfun = "halfnorm", output = "density", : object 'A' not found I would appreciate any and all help. rm(list=ls(all=TRUE)) #clear the computer's
2006 Aug 24
1
Using a 'for' loop : there should be a better way in R
I need to apply a yearly inflation factor to some wages and supply some simple sums by work category. I have gone at it with a brute force "for" loop approach which seems okay as it is a small dataset. It looks a bit inelegant and given all the warnings in the Intro to R, etc, about using loops I wondered if anyone could suggest something a bit simpler or more efficent? Example:
2004 Jul 24
0
rbind()
hi. I'm merging two datasets. one of them is 51 rows, and a typical row looks like this: midwar[midwar$dispnum==89,] dispnum synch sanum saname sbnum sbname year1 yearn ainit binit fatala 158 89 0 220 FRN 230 SPN 1822 1823 1 1 4 fatalb key1 keyn warnum year1.war yearn.war awon 158 5 2202301822 2202301823 1 1823 1823
2006 Dec 14
1
legend/plotmath/substitute problem
Dear R Experts, I am trying to produce a legend for a series of plots which are generated in a loop. The legend is supposed to look like this: 2000: gamma=1.8 where gamma is replaced by the greek letter and both the year and the value of gamma are stored in variables. Everything works fine as long as I have only one data series: year = 2001 g = 1.9 plot(1) legend('top',
2012 Jul 04
2
Date
Hi I have monthly data and the dates are in MM/YY Format I need to convert them into DD/MM/YY format by pasting 01 in place of DD to all the observations in my Year Column ex: Year Stock Prices 01/2000 1 02/2000 2 03/2000 3 I need to convert them to Year Stock Prices 01/01/2000 1 01/02/2000 2 01/03/2000
2013 Apr 03
1
linear model coefficients by year and industry, fitted values, residuals, panel data
Hi R-helpers, My real data is a panel (unbalanced and with gaps in years) of thousands of firms, by year and industry, and with financial information (variables X, Y, Z, for example), the number of firms by year and industry is not always equal, the number of years by industry is not always equal. #reproducible example firm1<-sort(rep(1:10,5),decreasing=F) year1<-rep(2000:2004,10)
2010 Jan 30
2
drawing a line that shifts from solid to broken
I am graphing longitudinal data from three time points. I'd like to draw a solid line from point 1 to point 2, and then a dashed line from point 2 to point 3. It works if I do it in two steps: > first.vector <- c(mean(year1$variable1), mean(year2$variable1)) > second.vector <- c(NA, mean(year2$variable1), mean(year3$variable1)) > plot(first.vector, type="b",
2012 May 24
1
svychisq using two frames
Hello, I?m hoping you have a few minutes to help out someone very new to R. I?ve done some searching, but cannot find this particular issue. I have survey data from two different time periods (years). Both years are stratified samples and have the same variables (and variable names), but are different people in the community answering in the different years. Everything loads into the survey
2010 Aug 20
1
Shifting of Principal amount while calculating Present Value
Dear R Helpers I have following data - cash_flow = c(7, 7, 107)  # 107 = Principle 100 + interest of 7% t = c(1,2,3) and zero rate table as rating         year1           year2           year3 AAA            3.60            4.17              4.73 AA              3.65            4.22              4.78 A                 3.72           4.32              4.93 BBB            4.10           
2012 Jun 24
2
Defining multiple variables in a loop
Good day, For lack of a better solution (or perhaps I am ignorant to something more elegant), I have been bootstrapping panel data by hand so to speak and I would like to know if there is a way to define multiple variables in a loop using the loop variable. I found a post (here: https://stat.ethz.ch/pipermail/r-help/2002-October/026305.html ) that discussed naming multiple variables but it
2011 Jul 04
4
How to build a matrix of number of appearance?
I have a matrix of claims at year1 that I get simply by claims<-read.csv(file="Claims.csv") qq1<-claims[claims$Year=="Y1",] I have MemberID and ProviderID for every claim in qq1 both are integers An example for the type of questions that I want to answer is how many times ProviderID number 345 appears together with MemberID 23 in the table qq1 In order to answer
2008 Oct 12
0
false convergence (8) after removal of the two-way interaction
Dear All, I am working with a generalized linear mixed-effects model with poisson error using the lme4 package in R. I created a model with the lmer function including some main effects, three two way interactions and two random effects. The model works well, but I have troubles when removing on of the two-way interactions. The Warning message: "In mer_finalize(ans) : false convergence
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers #I have a data panel of thousands of firms, by year and industry and #one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not #and another variable the represents the firm dimension (total assets in thousand of euros) #I need to create two separated samples with the same number os firms where #one firm in the first have a corresponding
2013 Apr 07
2
group data in classes
Hello all! I have a problem to group my data (years) in 10 years classes. For example for year year decade 1598 1590-1600 1599 1590-1600 1600 1590-1600 1601 1600-1610 --- my is like this> [1] 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 [16] 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 [31] 1628 1629 1630 1631 1632 1633
2010 Feb 24
1
Remove missing observations
Hi everyone I have the following problem: My dataframe has 3 variables: ID, Year and and an outcome variable. The dataframe contains repeated measurements because the subjects filled out a questionnaire every year. The time span covers 2 years. Now I want to check if there is a significant change in the outcome over the 2 years with a paired wilcox.test. The problem: Not every subject