Displaying 20 results from an estimated 800 matches similar to: "Extracting information from lm results (multiple model runs)"
2011 Aug 15
2
MCMC regress, using runif()
Hello,
just to follow up a question from last week. Here what I've done so far (here an example):
library(MCMCpack)
Y=c(15,14,23,18,19,9,19,13)
X1=c(0.2,0.6,0.45,0.27,0.6,0.14,0.1,0.52)
X2a=c(17,22,21,18,19,25,8,19)
X2b=c(22,22,29,34,19,26,17,22)
X2 <- function()runif(length(X2a), X2a, X2b)
model1 <- MCMCregress(Y~X1+X2())
summary(model1)
but I am not sure if my X2-function is
2011 Jul 28
1
Regression with ranges and displaying them in an XY-Plot
Hello UseRs,
I've got 3 variables, the dependent variable Y as well as a max and a min value of the independent variable (Xa and Xb) where in some cases Xa=Xb (so actually a single value for X).
First I'd like to perform a regression, but my problem is that my X is a range (acutally a censored independent variable Xa-Xb) rather then one single value. I know already some possible
2011 Aug 15
2
plotting segments only and in color
Hello,
I've a question concerning the display of interval data.
A sample dataset where X is an interval between Xa and Xb
which should be displayed:
Y=c(15,14,23,18,19,9,19,13)
Xa=c(17,22,21,18,19,25,8,19)
Xb=c(22,22,29,34,19,26,17,22)
X = (Xa+Xb)/2
It's easily possible to plot the mean of the interval like:
plot(X,Y)
afterwards I can create lines for the interval with:
2000 Dec 21
2
Réf. : configure.in: Someone please show me a better way :)
If I remove all the export and change all the ' in ", it does work on SCO
3.2v5.0.4
|--------+----------------------------->
| | Roumen Petrov |
| | <Roumen.Petrov at skal|
| | asoft.com> |
| | |
| | 21/12/00 13:10 |
| | |
2003 Jul 23
6
Condition indexes and variance inflation factors
Has anyone programmed condition indexes in R?
I know that there is a function for variance inflation factors
available in the car package; however, Belsley (1991) Conditioning
Diagnostics (Wiley) notes that there are several weaknesses of VIFs:
e.g. 1) High VIFs are sufficient but not necessary conditions for
collinearity 2) VIFs don't diagnose the number of collinearities and 3)
No one has
2011 Dec 06
5
Argument validation within functions
Hi,
I just started with writing functions in R and so some questions popped up.
I provide some values as argument to my function such as:
function(a,b,c){}
Now i want that the function first checks if the arguments are valid for the function. E.g argument "a" has to be a number in the range 0-1. How can that easily done?
So far I have:
a <- as.numeric(a)
if(0 <= a &&
2000 Dec 21
1
configure.in: Someone please show me a better way :)
Q: What platform don't run this script:
----------------------------------------
#!/bin/sh
export X0='x0'
export X1a="$X0/1"
export X1b='$X0/1'
export X2a="$X1a/2"
export X2b='$X1b/2'
$SHELL <<EOF_2
$SHELL <<EOF_1
cat <<EOF
#define a "$X2a/aa"
#define b "$X2b/bb"
EOF
EOF_1
EOF_2
2012 Feb 03
2
Assigning objects to variable and variable to list in a for loop
Hello,
I want to use a for loop for repeadely calculating
a maxent model (package dismo, function maxent()) which
creates an object of the class maxent (S4).
I want to collect all the resulting object in a list.
I tried to simplify my for loop to explain what I want.
There are two problems/questions:
1) How can I create the new variables in the loop (using paste) and assign the objects
2) How
2012 May 31
3
Remove columns from dataframe based on their statistics
Hi,
I have a dataframe and want to remove columns from it
that are populated with a similar value (for the total
column) (the variation of that column is 0). Is there an
easier way than to calculate the statistics and then
remove them by hand?
A <- runif(100)
B <- rep(1,100)
C <- rep(2.42,100)
D <- runif(100)
df <- data.frame(A,B,C,D) # if want to conditionally remove column B and
2017 Oct 12
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hi,
I recently ran into an inconsistency in the way model.matrix.default
handles factor encoding for higher level interactions with categorical
variables when the full hierarchy of effects is not present. Depending on
which lower level interactions are specified, the factor encoding changes
for a higher level interaction. Consider the following minimal reproducible
example:
--------------
>
2012 Jun 08
4
Sort 1-column dataframe with rownames
Hi,
I have a 1-column dataframe with rownames and I want to sort it
based on the single column. The typical procedure that is recommended
in diverse posts is to use order in the index. But that "destroys" my
dataframe structure. Probabaly it is a very simple solution. Here is a
short reproducable example:
x <- c(1,3,51,2,34,44,12,33,2,8)
df <- data.frame(x)
rownames(df) <-
2012 Feb 14
3
Wildcard for indexing?
Hi,
I'd like to know if it is possible to use wildcards * for indexing...
E.g. I have a vector of strings. Now I'd like to select all elements
which start with A_*? I'd also need to combine that with logical operators:
"Select all elements of a vector that start with A (A*) OR that start with B (B*)"
Probably that is quite easy. I looked into grep() which I think might
2017 Oct 27
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
I want to bring to your attention the following document: "What
happens if you omit the main effect in a regression model with an
interaction?" (https://stats.idre.ucla.edu/stata/faq/what-happens-if-you-omit-the-main-effect-in-a-regression-model-with-an-interaction).
This gives a useful review of the problem. Your example is Case 2: a
continuous and a categorical regressor.
2007 May 14
2
creating a "list of 3 dataframes" from a "list of 2 dataframes" and a dataframe?
#I wish to create a "list of three dataframes" ("results2") from a "list of two dataframes" (temp) and a dataframe ("c")?
#Please advise.
a <- data.frame(x=c(1,2,3),y=c(5,7,9))
b <- data.frame(x=c(2,4,7,9),y=c(2,3,5,4))
c <- data.frame(x=c(22,34,7,9),y=c(52,63,5,4))
results1 <- list(a,b,c) #what I want
#but this is how I need to get there
2011 Nov 24
2
dataframe indexing by number of cases per group
Hello,
assume we have following dataframe:
group <-c(rep("A",5),rep("B",6),rep("C",4))
x <- c(runif(5,1,5),runif(6,1,10),runif(4,2,15))
df <- data.frame(group,x)
Now I want to select all cases (rows) for those groups
which have more or equal 5 cases (so I want to select
all cases of group A and B).
How can I use the indexing for such questions?
df[??]...
2012 May 11
2
text(): combine expression and line break
Hi,
I would like to plot some extra text in my plot.
This should be a two line text including a special character (sigma).
I tried so far a to use expression in combination with paste and "\n"...
but I can't get the line break...
Here what I've done so far:
plot(1,type="n", xaxt='n', yaxt='n', ann=FALSE)
text(1,1,labels=expression(paste(sigma,"\n
2011 Nov 03
2
variable transformation for lm
Hello,
I am doing a simple regression using lm(Y~X).
As my response and my predictor seemed to be skewed
and I can't meet the model assumptions. Therefore
I need to transform my variables.
I wanted to ask what is the preferred way to find out
if predictor and/or response needs to be transformed
and if yes how (log-transform?).
I found a procedure in "A modern approach to Regressoin
in
2005 Nov 07
1
Newbie on functions
Hi,
I'm trying to write a simple function like
case1 <- function (m, cov, Q, R) {
theta <- (acos(R/sqrt(Q^3)))
beta <- (-2)*sqrt(Q)*cos(theta/3)+m[1]/3
rho1 <- (-2)*sqrt(Q)*cos((theta+2*pi)/3)+m[1]/3
rho2 <- (-2)*sqrt(Q)*cos((theta-2*pi)/3)+m[1]/3
stderrb <- deltamethod( ~(-2)*sqrt(Q)*cos(theta/3)+x1/3,m,cov)
stderrr1 <- deltamethod(
2017 Nov 02
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
Thank you for searching for, and finding, the basic description of the
behavior of R in this matter.
I think your example is in agreement with the book.
But let me first note the following. You write: "F_j refers to a
factor (variable) in a model and not a categorical factor". However:
"a factor is a vector object used to specify a discrete
classification"
2017 Nov 04
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
I rephrase my previous mail, as follows:
In your example, T_i = X1:X2:X3. Let F_j = X3. (The numerical
variables X1 and X2 are not encoded at all.) Then T_{i(j)} = X1:X2,
which in the example is dropped from the model. Hence the X3 in T_i
must be encoded by dummy variables, as indeed it is.
Arie
On Thu, Nov 2, 2017 at 4:11 PM, Tyler <tylermw at gmail.com> wrote:
> Hi