Displaying 20 results from an estimated 10000 matches similar to: "hierarchical mixture modelling"
2009 Nov 09
1
Quickly generate all possible combinations of 2 groups
Hi all,
I suspect the answer to this query will be the tongue-in-cheek "use a
quantum computer", but I thought my understanding might be
sufficiently limited that I'm missing a simpler option.
I'm looking for a way to cycle through all possible combinations of 2
groups of data. For 10 data points, that's 2^10 combinations, for 20
data points it's 2^20, etc. combn() from
2009 Nov 07
1
EM algorithm to fit circular mix of uniform+Von Mises
Hi all,
I'm curious if anyone has coded an Expectation-Maximization algorithm
that could help me model some circular data I have. I'd like to model
it as a mixture of uniform and Von Mises centered on 0, so the only
free parameters is the mixing proportion and the kappa of the Von
Mises. I couldn't find anything in the contributed packages that
seemed to suit this purpose. Any
2010 Feb 26
3
Preserving lists in a function
Dear R users,
A co-worker and I are writing a function to facilitate graph plotting in R. The function makes use of a lot of lists in its defaults.
However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the function. For example, if you feed the function codes below into R:
myfunction=function(
list1=list
2012 Feb 20
0
repeating or looping within an apply statement to handle multiple variables
Dear R experts,
I would like to please ask for your help with repeating steps in an apply
statement.
I have a dataframe that lists multiple variables for a given id and visit,
as well as drug treatment.
> head(exp)
id visit variable1 variable2 variable3 variable4 drug
1 3 1 13 10 7 11 0
2 3 5 10 15 9 9 0
3 3 12
2010 Sep 01
8
how to replace NA with a specific score that is dependant on another indicator variable
Hi everyone,
I’m looking for a clever bit of code to replace NA’s with a specific score
depending on an indicator variable.
I can see how to do it using lots of if statements but I’m sure there most
be a neater, better way of doing it.
Any ideas at all will be much appreciated, I’m dreading coding up all those
if statements!!!!!
My problem is as follows:
I have a data set with
2009 Jul 30
3
What is the best method to produce means by categorical factors?
I am attempting to replicate some of my experience from SAS in R and assume
there are best methods for using a combination of summary(), subset, and
which() to produce a subset of mean values by categorical or ordinal
factors.
within sas I would write
proc means mean data=dataset;
class factor1 factor2
var variable1 variable2;
RUN;
producing an output with means for each variable by factor
2012 Jan 02
4
Create variable with AND IF statement
Hello,
I'm using SPSS at work but really would like to switch to R. Right now I'm
trying to learn R in reproducing calculations I did with SPSS but am stuck
with something that is quite simple and comprehensible in SPSS-Syntax:
IF (variable1.fac = 0 AND variable2.num = 0) variable3=1.
IF (variable1.fac = 0 AND variable2.num >= 1) variable3=2.
IF (variable1.fac = 1 AND variable2.num =
2006 Jul 03
1
analogue of group option of SAS MIXED/random in R
Dear list,
I am trying to use lme to build the analogue of the following SAS MIXED
random specification:
random int+Variable1+Variable2 /subject = Subject group=Condition type=vc;
which gives a Condition-blocked heterogeneity in the random effects
variance-covariance matrix.
Needless to say, I have a hard time in specifying Condition-specific
heterogeneities in the variance-covariance
2009 Jan 29
1
Multiple tables
Dear list,
I have a set of 100+ variables. I would like to have one by one crosstables for each variable. I started with
table(variable1, variable2)
table(variable1, variable3)
table(variable1, variable4)
...
table(variable2, variable3)
table(variable2, variable4)
...
It seems rather tedious.
Any better ideas around?
Thanks for any help!
Gerit
--
NUR NOCH BIS 31.01.! GMX FreeDSL -
2009 Dec 04
2
Multiple Channel Variables with AMI Originate
Hi guys I seem to be having a problem, I don't know if it's a bug or whether
I'm just doing it incorrectly.
I want to set about 3 channel variables when I originate a call via AMI.
All the documentation I have found says to do it like this:
Variable: variable1=value|variable2=value|variable3=value
However when I do this it runs them all together and I end up with:
2011 Apr 18
4
altering identity column
Hi there,
I have a huge dataframe containing 70,000 observations.
I have filtered this dataframe (let it's name be "transformed_dataframe") as I wanted to select only those observations which are greater than or equal to 60,001 regarding the very first identity column.
So I have a transformed dataframe now including 10,000 obeservations (from 60,001 - to 70,000) and if you send
2007 Jun 13
3
Awk and Vilno
In clinical trial data preparation and many other data situations, the
statistical programmer needs to merge and re-merge multiple input
files countless times. A syntax for merging files that is clear and
concise is very important for the statistical programmer's
productivity.
Here is how Vilno does it:
inlist dataset1 dataset2 dataset3 ;
joinby variable1 variable2 where ( var3<=var4 ) ;
2006 Sep 24
2
printing a variable name in a for loop
Hello,
How do you print a variable name in a for loop?
I'm trying to construct a csv file that looks like this:
Hello, variable1, value_of_variable1, World,
Hello, variable2, value_of_variable2, World,
Hello, variable3, value_of_variable3, World,
Using this:
for (variable in list(variable1, variable2, variable3)){
cat("Hello,", ???variable???, variable, ",
2003 Apr 27
0
Radius app ?
Just wondered if anyone has done or is doing a radius app ?
There are several ways to deal with radius stuff.
Straight auth checking & for those with calling card applications stop
and start recording.
Even the situation of restricting to one call at a time could be done
so theft of time doesn't occur.
basically..
send to radiusauth(variable1,variable2)
retunrs auth (yes/no)
send
2008 May 05
1
Is there any way to find out how a certain functions are implemented in R?
Hello
I wrote a bootstrap program in C language that is called and run by R.
When I tried it, it is slow
and I'm trying to write and run the whole thing in C. But I cannot use
handy functions in R and
need to figure out how to write those functions by myself. Is there
any way that I can get the
actual codes that implement functions in R so that I can translate
them into other languages? For
2008 Mar 10
1
state space model for poisson distribution
Hi Rers,
I have a poission time series model with 5 parameters. I just wanted to remove two of the lag on response in the model and put it as a system model. I am not sure about the codes to combine these two on R. If anybody has any R example (code), please post it.
My original model: log(Y(t))~constant+b1*Y(t-1)+b2*Y(t-2)+b3*(variable1)+b4*(variable2)+e
I would like to construct a
2009 Dec 01
3
Using two (...) in a function
Hello R-Helpers,
I am not sure if it is a very simple question but I would like to use two
(...) in a function, for example,
this is a script where I would like to input the variable names (in one of
the (...)) and the variances associated to those variables which are not
calculated in the script because there is a specific software to calculate
it (the other (...))
data <- function
2012 Jul 09
4
Skipping lines and incomplete rows
I have a text file that has semi-colon separated values. The table is nearly
10,000 by 585. The files looks as follows:
*******************************************
First line: Skip this line
Second line: skip this line
Third line: skip this line
variable1 Variable2 Variable3 Variable4
Unit1 Unit2 Unit3
10 0.1 0.01 0.001
20
2012 Jan 17
2
result numeric(0) when using variable1[which(variable2="max(variable2)"]
Dear all,
I have a question about the knowing for which row I have the max value of
one of my variables.
I calculated the Rsquared for different columns and made a list to gather
them. I unlisted this list to create a vector with this values. I want to
know for which column I have the max value of Rsquared.
The columns were always named in the same way. They always start with
results4$depth_
2011 Apr 07
3
Correlation Matrix
Listers,
I have a question regarding correlation matrices. It is fairly straight
forward to build a correlation matrix of an entire data frame. I simply use
the command cor(MyDataFrame). However, what I would like to do is construct
a smaller correlation matrix using just three of the variable out of my data
set.
When I run this:
cor(MyDataFrame$variable1,