Hello everybody!
I have the following problem: I'd like to select a sample from a subsample
in a dataset. Actually, I don't want to select it, but to create a new
variable sampleNo that indicates to which sample (one or two) a case
belongs to.
Lets suppose I have a dataset containing 40 cases:
d
Hello everybody,
I have a problem regarding factor analysis:
As I am using the hetmat()-function from the polycor-package in order to
calculate different kinds of correlation coefficients automatically* I
cannot obtain
factor scores using fit$scores. The problem is that I am using the
fa()-functio
Hello everybody!
I have a (probabely very easy) problem. Even though I was looking in
several r-books
I could not find a suitable function to this problem, that's why I hope
that someone here
could help me:
# Sample data:
group<-c("A","A","A","B","B","C","C","C")
var1<-c(1,0,0,1,1,0,NA,1)
var2<-c
Hi everybody,
I have another question (to which I could not find an answer in my r-books.
I am sure, it's not a great issue, but I simply lack of a good idea how to
solve this:
One of my variables gets imported as a factor instead of a numeric variable.
Now I have a...
Factor w/ 63 levels "0","0
Hi everyone!
I have problems finding a solution to the following two problems:
My sample-dataframe consists of two variables "group" and "value":
group<-c("A", "A", "A", "B", "B", "B", "B", "C")
value<-c(1,3,2,2,2,4,4,1)
df<-as.data.frame(cbind(group, value))
Problem 1:
**
Now I'd like
Hi everybody,
does anyone of you know how to create a (crime) hotspot map using R?
Are there any packages or do you know any ressources?
It should be something like this:
http://www.caliper.com/Maptitude/Crime/MotorVehicleTheft2.png
(but it doesnt necessarely have to be a map)
Many thanks, David
n't think it answered the question that was
> > asked. That might be:
> >
> > c("red"[red], "green"[green], "blue"[blue])
> >
> > Cheers,
> > Bert
> >
> > On Mon, May 13, 2013 at 7:36 AM, Pascal Oettli wrote:
> >> H
Hello everybody,
I have three variables "blue", "green" and "red" containing values 0 (no)
and 1 (yes).
How can I easily create another variable "colors" with the values "blue",
"green" and "red"?
I hope that you can understand my question and appreciate any solutions or
hints!
Thank you!
David
Hi everybody!
Does anyone know a good way to color my images so that
when I print them out on a non-color-printer the colors used
can be distinguished well? As I have many categories I would
not want to assign the colors c("black", "grey", "white") by
hand.
Thank you!
[[alternative HTML
Hello everyone!
Does anyone of you know how I could solve the following problem.
I guess, it is not a very difficult question, but I simply lack of the
right idea:
I have a dataset containing data of convictions. This dataset contains 4
columns:
- personId: individual number that identifies the o
Hello everybody!
I have again a rather simple question concerning recoding of variables:
I have a variable/data-frame column BIRTHPLACE containing abbreviations of
the 26 swiss counties (AG, AI, AR, BE, ZH, ... )
as well as international country codes (USA, GER, ESP, etc.) and another
variable RE
Hi everybody!
I have a rather simple question:
# play data
persId<-c(1,2,3,1,4,5,2)
varA<-c(11,12,13,12,14,15,10)
df<-as.data.frame(cbind(persId, varA))
Now I'd like to create a new columns (df$new)
according to the value of df$VarA. For example
df$new1 should be 1 if df$varA==2 or df$new2 shou
Hello everybody!
I am trying to replace community numbers with community names (character).
I am using the following code:
data[data$commNo==786, "commNo"]<-"Name of the Community"
Unfortunately, I get the error message
missing values are not allowed in subscripted assignments of data frames
Hello everybody,
I imported an SAS data-file into R. open.sas7bdat() did not work,
so I had to convert it to csv first. Now I would like to recode the
value values into factors. Unfortunately I only have a SAS
syntax file, having this form:
proc format;
value $resstatus
'B'= 'Jahresaufenthalt
Hi everyone!
Can anyone tell me, how to obtain p.values from a linear model?
Example:
mod1<-lm(dV~iV1+iV2)
Now, I can get the coefficients with mod1$coef
But how can I get p-values? ($p.values seems to work with cor.test() only)
Thank you!
[[alternative HTML version deleted]]
Could anyone please tell me what is the most elegant
way to divide an ordinal variable in equal groups? (as
cut() does with continous variables)
for example I'd like to have the factor "educational level"
in three groups "low" "medium" and "high"
Thank you!
David
[[alternative HTML versi
Hi everybody!
I have a sample with n=2.000. This sample contains rare events (10, 20, 30
individuals with a specific illness).
Now I'd like to do a logistic regression in order to identify risk factors.
I have several independent variables on an interval
scale.
Does anyone know whether the number
Hi everybody!
Does anyone know how to obtain a inter-item-correlation-table
(with p-values or significance-levels)? (as SPSS does, either spearman or
pearson)
Repeatedly using cor.test() is pretty exhausting as the table size
increases...
Thank you!
David
[[alternative HTML version del
Hi everybody!
I would like to plot a barplot, but, unfortunately, when I change the
y-axis limits
the bars do not start at 0 any more but get negative:
#
# Data (just a short example):
a<-c(1.61, 2.1)
b<-c(1.5, 1.9)
c<-c(1.85, 2.2)
d<-c(1.63, 2.3)
Hi everyone!
I have to following question: I have three items that had
to be ordered (e.g. three persons were rating var1 on the
first rank):
var1 var2 var3
123
213
132
123
Now I'd like to have the data.frame "the other way round", so that
the ranks are in the col
Hi everyone!
I have the following difficulties using ggplot2
# My Data
data<-as.data.frame(cbind(a=c(1,1,2,2,2,2,3,3,4), b=c(1,2,3,3,4,4,4,4,4)))
And I would like to plot the frequency-distributions of both variables in
one plot as lines. For both variables the values (1-4) should be on the
x-ax
Hello everybody,
I know this is pretty basic stuff, but could anyone explain me how to
recode a single value of a variable
into a missing value?
I used to do it like this:
myData[myData$var1==5;"var1"]<-NA # recode value "5" into "NA"
But the column "var1" already contains NAs, whic
Hello everybody!
I have again another newbie-question. I was trying to plot three curves
within one single
plot: Crime development (relative frequencies) according to the hours of tv
consume per week (high/low/all together).
Here are the data:
par(mfrow=c(1,1))
# Data input
tvHrs<-c(21,22,23,24,2
Hello everybody,
Can anyone tell me, how to obtain standardized regression coefficients
(betas) for
my independent variables when doing a multiple linear regression?
height<-c(180,160,150,170,190,172)
sex<-c(1,2,2,1,1,2)
age<-c(40,20,30,40,20,25)
fit<-lm(height~age+sex)
summary(fit)
I already h
Hello everybody,
I have the following problem and have no idea how to solve it:
In my dataframe I have six columns representing six societal problems (p1,
p2, ..., p6).
The values are ranks between 1 (worst problem) and 6 (best problem)
p1 p2 p3 p4 p5 p6
1 3 2 5 4 6
2 3 1 6 4
Hello everybody!
Let's assume I have the following factor with it's levels:
a<-factor(c(2,3,3,2,4,2,3,2,2,2,3,2,3))
mydata<-data.frame(a)
When I plot the vector "a" using
barplot(table(mydata$a)
unfortunately the value "1" does not
show up, as it does not appear in my data.
But still, it theor
Hello,
I have the following question:
when creating a data.frame
a1<-c(1,2,3)
a2<-c(1,2,3)
c<-data.frame(a1,a2)
I can select columns using an index like:
c[,1:2]
Is this possible too when using column-names? (something like c(,"a1":"a2"),
which doesn't work)
Alternative question: Is there a fu
27 matches
Mail list logo