search for: nweek

Displaying 2 results from an estimated 2 matches for "nweek".

Did you mean: week
2006 Apr 06
1
polynomial predict with lme
.... Or am I doing something daft? Milk yield for five cows is measured weekly for 45 weeks. Yield is simulated as cubic function of weekno + random cow effect (on intercept) + residual error. I want to recover an estimate of the fixed curve. ############### library(nlme) set.seed(1) ncows <- 5; nweeks <- 45; week <- 1:nweeks mcurve <- 25 + 0.819*week - 0.0588*week^2 + 0.000686*week^3 cow.eff <- rnorm(ncows) week <- rep(week, ncows) cow <- gl(ncows,nweeks) yield <- mcurve + cow.eff[cow] + rnorm(ncows*nweeks) lmefit <- lme(yield ~ poly(week,3), random = ~1|cow) summary(lm...
2009 Mar 07
1
Week value function
Hi R users, I am looking for a date function that will give the following: - The number-of-week value is in the range 01-53 - Weeks begin on a Monday and week 1 of the year is the week that includes both January 4th and the first Thursday of the year. If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of the last week of the preceding