Displaying 4 results from an estimated 4 matches for "forvalu".
Did you mean:
forval
2010 Jan 21
3
cross validation function translated from stata
...robabilities, compute the net benefit at various
threshold probabilities.
#6. Repeat steps (1) to (5) 200 times. The corrected net benefit for each
threshold probability is the mean across the 200 replications.
=================================================================
First is stata code.
forvalues i=1(1)200 {
local event="cancer"
local predictors1 = "total_psa"
local predictors2 = "total_psa free_psa"
local prediction1 = "base"
local prediction2 = "full"
g `prediction1'=.
g `prediction2'=.
quietly g u = uniform()
sort `event'...
2011 Oct 09
2
variable name question
...ar:
pci1990, pci1991, ... , pci2009.
"pci1990" has data on per capita income for 1990, "pci1991" has data on
per capita income for 1991, and so on.
I would like to create the logarithm of per capita for each of the year
and could do so in STATA with the following commands:
forvalues number = 1990/2009 {
gen lpci`number' = log(pci`number')
}
What would be the corresponding set of commands in R?
Thanks a lot in advance.
Deepankar
2010 Aug 04
2
does R have a command the same with Stata's loop command: ` '
hey, Rers
in Stata therer is a loop command ` ' which could do the following:
forvalue i=1/10 {
?gen?x`i'=expression
}
this will generate variable: x1,x2,,,,,x10. so, does R have a corresponding one
to this?
And one more very basic question: after I open a file and modify it, such as
generate some new variables and change some old ones, how to use the changed
dataset in an...
2011 May 05
1
Looping over graphs in igraph
...separately--to
look only at the edges when the graph identifier is 1, make calculations on
that graph, then do it again for 2 and so forth. I suspect that this isn't
related to igraph specifically--I just don't know the equivalent command in
R for what in pseudo Stata code would read as:
forvalues i of 1/N {
temp_graph=subrows of the main csv file for which graphid==`i'
cs`i' = leading.eigenvector.community.step(temp_graph)
convert cs`i'$membership into a column in the original csv
}
I want the output to look something like:
Graph ID | Vertex1 | Vertex2 | weight | Vertex...