I need to change a dataframe that is has a variable arranged by date like this:
ID Var_Day1 Var_Day2 Var_Day3
1 2 66 222
2 5 55 333
3 6 44 555
4 3 33 444
5 4 22 333
into a new dataframe with one column for the variable for all days. Something like this:
ID Day Var
1 1 2
I am admittedly very dumb when it comes at reshaping data in R. So, I would appreciate to have some suggestion on what follows.
I got the appended dataset with three columns:
the first 2 contains codes for sites, the last column is the distance (in meters) between each pairs of sites...
I have a data frame with several factor variables and one numeric variable that gives the number of times a row with the given combination of factor values was obseved. I would like to disaggregate (if there is a such a word) the data frame to get one where a factor combination is...
I have a dataset where each services offer by providers is in one row. However my goal is that each provider represents one row.
I would like to create a variable that represents the LEAD grantee of my provider. Note that providers can have more than one grantee. For...
These are my variables:
Funding= Funding type there are 4 funding types (a,b,c,d)
ProviderID=provider of the services
Services= type of services (there can be 5 different type of services).
In this dataset the services is the unit of analysis. Basically, I want...
Hello everybody! I have values for prices for each year (price_1998, price_1999 etc), the avarage prices(aprice_1998, aprice_1999..), the marginal prices(mprice_1998, mprice_1999..). I have to build a graph, on the y axis i need the prices and on the x axis i should have the years(1998, 1999...
I really need help with this on. I have a dataset of healthcare organization with the following variables:
ContactID : organization ID
Quarter : data reporting period - first or second quarter
Services : services provide
Clients : how many...
I have a data frame which looks like :
Jan_V Jan_S Feb_V Feb_S
1 100 90 120 110
2 123 88 112 120
3 121 89 134 130
There are around 200 rows.
The data frame can have additional month columns i.e. Mar_V...
I really need your help. I'm new to Stata so it might be easy to answer for you guys... I have an excel sheet that lists stock prices for specific firms (about 800) on each trading day for 10 years. Firms (coded by their German stock exchange code) are arranged in ROW and dates in COLUMN...
I have data for lets say 10 health centers. There are a series of variables that ask for number of clients serve by age group. For example.
var1= provide emergency contraception to 12-14 years old.
var2 = provide emergency contraception to 15-17 years old.
var3= provide emergency...
I reshaped my dataset and now my encoded variables have more categories than they had. What may be the cause? (PERS_ID is the identifier for the person while STU_ID identifies the identification number and then change if the student switches between majors in the university system of my...
I have a HH dataset consiting of about 50 or so subsets which I am trying to merge together. The following problem occures. In some of these datasets there are more observations then individuals in the survey because data on jobs has been coded as job1, job2, job3 etc... each...
I need to reshape below matrix with or without do loop:
Below is my question:
X1 X2 X3 X4 X5 X6
18.25766 123.9019 151.4487 34.1252 196.6713 231.2289
16.89285 121.7344 146.5685 60.4828 299.1966 346.6185...