search for: fit1s

Displaying 20 results from an estimated 355 matches for "fit1s".

Did you mean: fit1
2013 Feb 08
3
On p-values presented in the summary of Linear Models
Dear list members I have a doubt on how p-values for t-statistics are calculated in the summary of Linear Models. Here goes an example: x <- rnorm(100,50,10) y <- rnorm(100,0,5) fit1<-lm(y~x) summary(fit1) summary(fit1)$coef[2] # b summary(fit1)$coef[4] # Std. Error summary(fit1)$coef[6] # t-statistic summary(fit1)$coef[8] # Pr(>|t| summary(fit1)$df [2] # degrees of freedom #
2005 Jul 21
1
About object of class mle returned by user defined functions
Hi, There is something I don't get with object of class "mle" returned by a function I wrote. More precisely it's about the behaviour of method "confint" and "profile" applied to these object. I've written a short function (see below) whose arguments are: 1) A univariate sample (arising from a gamma, log-normal or whatever). 2) A character string
2009 Apr 15
2
AICs from lmer different with summary and anova
Dear R Helpers, I have noticed that when I use lmer to analyse data, the summary function gives different values for the AIC, BIC and log-likelihood compared with the anova function. Here is a sample program #make some data set.seed(1); datx=data.frame(array(runif(720),c(240,3),dimnames=list(NULL,c('x1','x2','y' )))) id=rep(1:120,2); datx=cbind(id,datx) #give x1 a
2011 Mar 25
2
A question on glmnet analysis
Hi, I am trying to do logistic regression for data of 104 patients, which have one outcome (yes or no) and 15 variables (9 categorical factors [yes or no] and 6 continuous variables). Number of yes outcome is 25. Twenty-five events and 15 variables mean events per variable is much less than 10. Therefore, I tried to analyze the data with penalized regression method. I would like please some of the
2004 Jun 11
1
comparing regression slopes
Dear List, I used rlm to calculate two regression models for two data sets (rlm due to two outlying values in one of the data sets). Now I want to compare the two regression slopes. I came across some R-code of Spencer Graves in reply to a similar problem: http://www.mail-archive.com/r-help at stat.math.ethz.ch/msg06666.html The code was: > df1 <- data.frame(x=1:10, y=1:10+rnorm(10))
2012 Nov 08
2
Comparing nonlinear, non-nested models
Dear R users, Could somebody please help me to find a way of comparing nonlinear, non-nested models in R, where the number of parameters is not necessarily different? Here is a sample (growth rates, y, as a function of internal substrate concentration, x): x <- c(0.52, 1.21, 1.45, 1.64, 1.89, 2.14, 2.47, 3.20, 4.47, 5.31, 6.48) y <- c(0.00, 0.35, 0.41, 0.49, 0.58, 0.61, 0.71, 0.83, 0.98,
2004 Dec 13
1
AIC, glm, lognormal distribution
I'm attempting to do model selection with AIC, using a glm and a lognormal distribution, but: fit1<-glm(BA~Year,data=pdat.sp1.65.04, family=gaussian(link="log")) ## gives the same result as either of the following: fit1<-glm(BA~Year,data=pdat.sp1.65.04, family=gaussian) fit1<-lm(BA~Year,data=pdat.sp1.65.04) fit1 #Coefficients: #(Intercept) Year2004 # -1.6341
2008 Jan 05
1
Likelihood ratio test for proportional odds logistic regression
Hi, I want to do a global likelihood ratio test for the proportional odds logistic regression model and am unsure how to go about it. I am using the polr() function in library(MASS). 1. Is the p-value from the likelihood ratio test obtained by anova(fit1,fit2), where fit1 is the polr model with only the intercept and fit2 is the full polr model (refer to example below)? So in the case of the
2010 Nov 10
1
standardized/studentized residuals with loess
Hi all, I'm trying to apply loess regression to my data and then use the fitted model to get the *standardized/studentized residuals. I understood that for linear regression (lm) there are functions to do that:* * * fit1 = lm(y~x) stdres.fit1 = rstandard(fit1) studres.fit1 = rstudent(fit1) I was wondering if there is an equally simple way to get the standardized/studentized residuals for a
2012 May 28
0
GLMNET AUC vs. MSE
Hello - I am using glmnet to generate a model for multiple cohorts i. For each i, I run 5 separate models, each with a different x variable. I want to compare the fit statistic for each i and x combination. When I use auc, the output is in some cases is < .5 (.49). In addition, if I compare mean MSE (with upper and lower bounds) ... there is no difference across my various x variables, but
2011 Oct 06
1
anova.rq {quantreg) - Why do different level of nesting changes the P values?!
Hello dear R help members. I am trying to understand the anova.rq, and I am finding something which I can not explain (is it a bug?!): The example is for when we have 3 nested models. I run the anova once on the two models, and again on the three models. I expect that the p.value for the comparison of model 1 and model 2 would remain the same, whether or not I add a third model to be compared
2011 Jan 24
5
Train error:: subscript out of bonds
Hi, I am trying to construct a svmpoly model using the "caret" package (please see code below). Using the same data, without changing any setting, I am just changing the seed value. Sometimes it constructs the model successfully, and sometimes I get an ?Error in indexes[[j]] : subscript out of bounds?. For example when I set seed to 357 following code produced result only for 8
2008 Feb 23
3
using subset() in data frame
R folks, As an R novice, I struggle with the mystery of subsetting. Textbook and online examples of this seem quite straightforward yet I cannot get my mind around it. For practice, I'm using the code in MASS Ch. 6, "whiteside data" to analyze a different data set with similar variables and structure. Here is my data frame: ###subset one of three cases for the variable
2009 Feb 12
0
Comparing slopes in two linear models
Hi everyone, I have a data frame (d), wich has the results of mosquitoes trapping in three different places. I suspect that one of these places (Local=='Palm') is biased by low numbers and will yield slower slopes in the variance-mean regression over the areas. I wonder if these slopes are diferents. I've looked trought the support list for methods for comparing slopes and found the
2008 Dec 01
1
Comparing output from linear regression to output from quasipoisson to determine the model that fits best.
R 2.7 Windows XP I have two model that have been run using exactly the same data, both fit using glm(). One model is a linear regression (gaussian(link = "identity")) the other a quasipoisson(link = "log"). I have log likelihoods from each model. Is there any way I can determine which model is a better fit to the data? anova() does not appear to work as the models have the
2008 Apr 17
1
survreg() with frailty
Dear R-users, I have noticed small discrepencies in the reported estimate of the variance of the frailty by the print method for survreg() and the 'theta' component included in the object fit: # Examples in R-2.6.2 for Windows library(survival) # version 2.34-1 (2008-03-31) # discrepancy fit1 <- survreg(Surv(time, status) ~ rx + frailty(litter), rats) fit1 fit1$history[[1]]$theta
2009 May 05
2
Stepwise logistic Regression with significance testing - stepAIC
Hello R-Users,   I have one binary dependent variable and a set of independent variables (glm(formula,…,family=”binomial”) ) and I am using the function stepAIC (“MASS”) for choosing an optimal model. However I am not sure if stepAIC considers significance properties like Likelihood ratio test and Wald test (see example below).     > y <- rbinom(30,1,0.4) > x1 <- rnorm(30) > x2
2009 Apr 08
2
Null-Hypothesis
Hello R users, I've used the following help two compare two regression line slopes. Wanted to test if they differ significantly: Hi, I've made a research about how to compare two regression line slopes (of y versus x for 2 groups, "group" being a factor ) using R. I knew the method based on the following statement : t = (b1 - b2) / sb1,b2 where b1 and b2 are the two slope
2020 Sep 29
5
2 KM curves on the same plot
Hello, Can anyone suggest a simple way to generate a Kaplan-Meier plot with 2 survfit objects, just like this one:? https://drive.google.com/file/d/1fEcpdIdE2xYtA6LBQN9ck3JkL6-goabX/view?usp=sharing Suppose I have 2 survfit objects: fit1 is for the curve on the left (survtime has been truncated to the cutoff line: year 5), fit2 is for the curve on the right (minimum survival time is at the
2011 Jan 21
2
Looping with incremented object name and increment function
Folks, I am trying to get a loop to run which increments the object name as part of the loop. Here "fit1" "fit2" "fit3" and "fit4" are linear regression models that I have created. > for (ii in c(1:4)){ + SSE[ii]=rbind(anova(fit[ii])$"Sum Sq") + dfe[ii]=rbind(summary(fit[ii])$df) + } Error in anova(fit[ii]) : object 'fit' not found