R語言
balancedGrouped
位於 nlme
包(package)。 說明
從數據矩陣創建 groupedData
對象。此函數隻能用於平衡數據。相反的轉換,即從 groupedData
對象到 matrix
,是通過 asTable
完成的。
用法
balancedGrouped(form, data, labels=NULL, units=NULL)
參數
form |
|
data |
矩陣或 DataFrame ,包含根據分組因子級別(行)和主協變量不同級別(列)分組的響應值。矩陣的 |
labels |
一個可選的字符串列表,為響應和主要協變量提供標簽。主協變量的標簽名為 |
units |
給出響應和主要協變量單位的可選字符串列表。主協變量的單位字符串名為 |
值
平衡的 groupedData
對象。
例子
OrthoMat <- asTable( Orthodont )
Orth2 <- balancedGrouped(distance ~ age | Subject, data = OrthoMat,
labels = list(x = "Age",
y = "Distance from pituitary to pterygomaxillary fissure"),
units = list(x = "(yr)", y = "(mm)"))
Orth2[ 1:10, ] ## check the first few entries
# Pinheiro and Bates, p. 109
ergoStool.mat <- asTable(ergoStool)
balancedGrouped(effort~Type|Subject,
data=ergoStool.mat)
作者
José Pinheiro and Douglas Bates bates@stat.wisc.edu
參考
Pinheiro, J. C. and Bates, D. M. (2000), Mixed-Effects Models in S and S-PLUS, Springer, New York.
也可以看看
相關用法
- R bdf 語言成績
- R Pixel X 射線像素強度隨時間的變化
- R corARMA ARMA(p,q) 相關結構
- R getGroupsFormula 提取分組公式
- R corRatio 有理二次相關結構
- R logLik.glsStruct glsStruct 對象的對數似然
- R intervals.lmList lmList 係數的置信區間
- R corLin 線性相關結構
- R plot.augPred 繪製 augPred 對象
- R print.varFunc 打印 varFunc 對象
- R recalc 重新計算壓縮線性模型對象
- R Variogram.corSpher 計算 corSpher 對象的半變異函數
- R getGroups.lme 提取 lme 對象組
- R nlmeStruct 非線性混合效應結構
- R predict.nlme 來自 nlme 對象的預測
- R corSymm 一般相關結構
- R qqnorm.gls gls 對象殘差的正態圖
- R pdCompSymm 具有複合對稱結構的正定矩陣
- R [.pdMat 下標 pdMat 對象
- R pdConstruct.pdBlocked 構造 pdBlocked 對象
- R gapply 按組應用函數
- R recalc.modelStruct 重新計算 modelStruct 對象
- R Remifentanil 瑞芬太尼藥代動力學
- R plot.nmGroupedData 繪製 nmGroupedData 對象
- R pdBlocked 正定分塊對角矩陣
注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Create a groupedData object from a matrix。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。