search for: testlm

Displaying 5 results from an estimated 5 matches for "testlm".

Did you mean: testl
2008 Jun 07
2
Predicting a single observatio using LME
...3 13 -0.842322442 1 1 4 14 -0.657256158 2 1 4 15 1.504491575 3 1 4 16 2.896007045 4 1 4 17 0.990505440 1 1 5 18 2.722942793 2 1 5 19 4.395861278 3 1 5 20 4.849296475 4 1 5 21 3.049616421 1 1 6 22 2.874405962 2 1 6 23 4.359511097 3 1 6 24 6.165419699 4 1 6 This happened: > testLME <- lme(Y~t+D,data=simpledata,random=~1|ID) > predict(testLME, simpledata[1,]) Error in val[revOrder, level + 1] : incorrect number of dimensions This has occurred with other datasets as well. Is this a bug in the code, or am I doing something wrong? (Also, is there a way to parse a formul...
2007 Aug 20
1
rv package, rvnorm function
...read.table("rv_data.txt",header=TRUE) # Extract data. attach(testscores) # Put testscores in R search path testscores[1:2,] # Print first 2 observations testscores[14:15,] # Print last 2 observations x <- testscores[,1] # midterm scores y <- testscores[,2] # final exam scores testlm <- lm(y ~ x) # fit linear model by OLS sigma.hat <- sqrt(deviance(testlm)/df.residual(testlm)) # deviance(testlm) is equivalent to sum(residuals(testlm)^2) beta.hat <- coefficients(testlm) V.beta <- vcov(testlm)/(sigma.hat^2) # unscaled covariance matrix n <- 10 library(rv) sigma &l...
2010 Oct 25
2
Question on passing the subset argument to an lm wrapper
...a wrapper function to lm. I want to pass in a subset argument. First, I just thought I'd use "...". ## make example reproducible set.seed(123) df1 <- data.frame(age = rnorm(100, 50, 10), bmi = rnorm(100, 30, sd = 2)) ## create a wrapper using "..." testlm <- function(formula, ...) { lm(formula, data = df1, ...) } > testlm(bmi ~ age, subset = age > 50) Error in eval(expr, envir, enclos) : ..1 used in an incorrect context, no ... to look in I found some other examples of this error message, but couldn't piece together how it fit...
2002 Sep 27
3
? Exact pattern matching in GREP ?
How is exact pattern matching achieved in GREP (and GREPlike) functions ? # Want: listing of all object names that end in *.lm > objects(pattern="*.lm",pos=1) # ... but get: all objects that partially match *.lm, e.g., *.lme [1] "j3.lm" "J3.lme" "j8.lm" "J8.lme" # Want: position of string "4jan2002" in vector >
2008 Jun 06
6
Subsetting to unique values
I want to take the first row of each unique ID value from a data frame. For instance > ddTable <- data.frame(Id=c(1,1,2,2),name=c("Paul","Joe","Bob","Larry")) I want a dataset that is Id Name 1 Paul 2 Bob > unique(ddTable) Will give me all 4 rows, and > unique(ddTable$Id) Will give me c(1,2), but not accompanied by the name column.